Skip to content

Commit 7d4c316

Browse files
committed
Fix for issue kunal-kushwaha#1388 - correcting isSafe method in sudoku solver.
1 parent 6bc4d8b commit 7d4c316

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lectures/14-recursion/code/src/com/kunal/backtracking/SudokuSolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static boolean isSafe(int[][] board, int row, int col, int num) {
8080
// check the row
8181
for (int i = 0; i < board.length; i++) {
8282
// check if the number is in the row
83-
if (board[row][i] == num) {
83+
if (board[i][col] == num) {
8484
return false;
8585
}
8686
}

0 commit comments

Comments
 (0)