LC 36

Valid Sudoku

Medium · LC 1–100

arrayhash-tablematrix
Free

Candidate solution routes

Primary

Constraint-satisfaction backtracking

Free

Invariant: At recursion entry, the partial assignment satisfies every activated constraint and every auxiliary set/count exactly matches it; a pruned branch has no legal completion.

candidate confidence: 0.540 · metadata_only

Alternate 1

Prefix State plus Hash Frequency

Free

Invariant: Before processing position i, the table contains exactly the historical prefixes allowed as left boundaries; query-before-insert avoids using a future or self state accidentally.

candidate confidence: 0.368 · metadata_only

How to use this page

Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.