c# - Sudoku validity check algorithm - how does this code works? - Stack Overflow
Really a nice idea.
Basically, it uses an int
flag (initially set to zero) as a "bit array"; for each value, it checks if the corresponding bit in the flag is set, and if it's not, it sets it.
If, instead, that bit position is already set, it knows that the corresponding value has already been seen, so the piece of Sudoku is invalid.
Read full article from c# - Sudoku validity check algorithm - how does this code works? - Stack Overflow
No comments:
Post a Comment