sudoku 6x6 java

Solutions on MaxInterview for sudoku 6x6 java by the best coders in the world

showing results for - "sudoku 6x6 java"
Luka
18 Sep 2019
1private boolean solve(int[][] board) {
2    for (int row = BOARD_START_INDEX; row < BOARD_SIZE; row++) {
3        for (int column = BOARD_START_INDEX; column < BOARD_SIZE; column++) {
4            if (board[row][column] == NO_VALUE) {
5                for (int k = MIN_VALUE; k <= MAX_VALUE; k++) {
6                    board[row][column] = k;
7                    if (isValid(board, row, column) && solve(board)) {
8                        return true;
9                    }
10                    board[row][column] = NO_VALUE;
11                }
12                return false;
13            }
14        }
15    }
16    return true;
17}