FreeCareerPath
Build the PrimitiveMedium

Valid Sudoku

Write `is_valid_sudoku(board)` for a 9x9 board given as a list of 9 lists of single-character strings, where `"."` marks an empty cell. Return `True` if no row, column, or 3x3 box contains a repeated digit. Only the filled cells are checked — the board does not have to be solvable, or even solved. Three separate passes work. One pass with three arrays of sets is better, and the only fiddly part is mapping a cell to its box: `(row // 3) * 3 + col // 3`.

What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.

Log in to start this session

Timed sessions and your results for "Valid Sudoku" are saved to your account — logging in takes a few seconds.