LC 20
Valid Parentheses
Easy · LC 1–100
Candidate solution routes
Primary
FreeBalanced-Delimiter Stack
Invariant: After a prefix, the stack contains exactly its unmatched openers in occurrence order; the top is the only opener the next closer may legally match.
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.