LC 59
Spiral Matrix II
Medium · LC 1–100
Candidate solution routes
Primary
FreeExplicit simulation / state machine
Invariant: At loop entry, state completely describes the real process configuration, and one transition is definitionally equivalent to one rule step.
candidate confidence: 0.740 · 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.