Skip to content

Commit

Permalink
Update Sudoku.java
Browse files Browse the repository at this point in the history
  • Loading branch information
f4r4z authored Mar 15, 2018
1 parent ef5cbb7 commit 4e81dea
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Sudoku.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ private boolean solve(int row, int col) {
return true;
}

//checks for already existing numbers
if(board[row][col] != 0) {
if(check(row, col, board[row][col])) {
return nextPos(row, col);
}
}


int num = board[row][col];

//checks each number from 1 to 9
for(int i = 1; i < 10; i++) {

Expand All @@ -54,17 +52,12 @@ private boolean solve(int row, int col) {
if(nextPos(row, col)) {
return true;
}



}

//clears the previous positions
board[row][col] = 0;

}


return false;
}

Expand Down

0 comments on commit 4e81dea

Please sign in to comment.