public boolean isValidSudoku(char[][] board) {

    final int N = 9;

    boolean[][] rows = new boolean[N][N];
    boolean[][] cols = new boolean[N][N];
    boolean[][] blks = new boolean[N][N];

    for (int i = 0 ; i < N ; i++) {
      for (int j = 0 ; j < N ; j++) {
        if (board[i][j] == '.') {
          continue;
        }
        int curt = board[i][j] - '1';
        if (rows[i][curt] || cols[curt][j] || blks[i - i % 3 + j / 3][curt]) {
          return false;
        }
        rows[i][curt] = cols[curt][j] = blks[i - i % 3 + j / 3][curt] = true;
      }
    }

    return true;
  }