Code Room4x4 Sudoku completions
HardPrep Room Coding #1365

4x4 Sudoku completions

CodingAlgorithms & data structuresSenior–Staff~35 min

You are given a 4x4 Sudoku board as a list of 4 rows; each cell holds 0 (blank) or a value in 1..4. A completion fills every blank so that each row, each column, and each of the four 2x2 boxes contains the digits 1,2,3,4 exactly once. The given clues are guaranteed not to already violate these rules. Return the number of valid completions (0 if none).

Implement
count_sudoku_completions(board: list[list[int]]) → int
Examples
in[[[1,2,3,4],[3,4,1,2],[2,1,4,3],[4,3,2,0]]]out1
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 35 min
InputExpectedGot
[[[1,2,3,4],[3,4,1,2],[2,1,4,3],[4,3,2,0]]]1not run yetsample