private boolean solveSudokuUtil(char[][] input, boolean[][] horizontal, boolean[][] vertical, boolean[][] box, int row, int col) {
        if (col == 9) {
            row = row + 1;
            col = 0;
        }
        if (row == 9) {
            return true;
        }

        if (input[row][col] != '.') {
            return solveSudokuUtil(input, horizontal, vertical, box, row, col + 1);
        }

        for (int val = 1; val <= 9; val++) {
            int index = 3*(row/3) + col/3;
            if (horizontal[row][val - 1] == false && vertical[col][val - 1] == false && box[index][val - 1] == false) {
                horizontal[row][val - 1] = true;
                vertical[col][val - 1] = true;
                box[index][val - 1] = true;
                input[row][col] = (char)(val + '0');
                if (solveSudokuUtil(input, horizontal, vertical, box, row, col + 1)) {
                    return true;
                }
                input[row][col] = '.';
                horizontal[row][val - 1] = false;
                vertical[col][val - 1] = false;
                box[index][val - 1] = false;
            }
        }
        return false;
    }
Date 03/24/2016
@author Tushar Roy

Write a program to solve a Sudoku puzzle by filling the empty cells.

https://leetcode.com/problems/sudoku-solver/
src/com/interview/recursion/SudokuSolver.java