Mental Model
We build a tree of letters from all words, then find the longest word where every prefix is also a word.
Analogy: Imagine a family tree where each generation is a letter, and only branches where every ancestor is known are valid paths to the longest name.
root ↓ t -> r -> i -> e ↑ ↑ ↑ ↑ end end end end Each node points to next letter; 'end' marks a complete word.
