I\'m trying to code an algorithm that creates a legal Sudoku board in either Java or Javascript. Neither work, and I\'m not entirely sure why.
Essentially, the prob
In Java array indexes are zero-based. In nextBoard
you loop over 1..9
for i
and use it as an index into toCheck
which will skip the first element at index 0
and go past the end of the array. This will throw ArrayIndexOutOfBoundsException
if the line containing toCheck[i]
is reached with i
equal to 9
.