LC 14
Longest Common Prefix
Easy · LC 1–100
Candidate solution routes
Primary
FreeTrie prefix search
Invariant: Every Trie node denotes one unique prefix; its children are exactly the next characters occurring after that prefix in inserted words, and terminal is true only at complete word ends.
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.