public boolean solveSudokuRec(char [][] board, boolean [][] rows, boolean [][] cols, boolean [][] cells, int level){
        if(level == 81) {
            return true;
        }
        int i = level / 9;
        int j = level % 9;
        if(board[i][j] != '.') {
            return solveSudokuRec(board, rows, cols, cells, level+1);
        }
        for(int k = 0; k < 9; ++k){
            if(!rows[i][k] && !cols[j][k] && !cells[3*(i/3)+(j/3)][k]) {
                board[i][j] = (char) (k + 1 + '0');
                rows[i][k] = true;
                cols[j][k] = true;
                cells[3 * (i / 3) + (j / 3)][k] = true;
                if (!solveSudokuRec(board, rows, cols, cells, level+1)) {
                    board[i][j] = '.';
                    rows[i][k] = false;
                    cols[j][k] = false;
                    cells[3 * (i / 3) + (j / 3)][k] = false;
                } else {
                    return true;
                }
            }
        }
        return false;
    }