LC 10
Regular Expression Matching
Hard · LC 1–100
Candidate solution routes
Primary
FreeLinear dynamic programming
Invariant: After processing i, every state through i equals the true value under its definition, and every future transition reads only these finalized states.
candidate confidence: 0.713 · metadata_only
Alternate 1
FreeParsing / token state machine
Invariant: Before each loop, s[:i] has been completely and non-overlappingly tokenized; the next rule consumes at least one character or reports an error.
candidate confidence: 0.658 · 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.