ASAPUtils Logo ASAPUtils
Week 1

Valid Sudoku

Valid Sudoku in one pass using 27 hash sets, with C++ and JavaScript solutions and a derivation of the box index formula that makes the whole problem collapse into three duplicate checks.

The problem

Given a 9 by 9 Sudoku board partially filled with digits and dots for empty cells, determine whether the filled cells are valid — no repeats within any row, any column, or any of the nine 3 by 3 boxes. The board need not be solvable.

A board with two 8s in the same 3x3 box -> false

Related Problems