Mental Model
We build a tree where each path from root to a node forms a word prefix. We find the longest word where every prefix is also a word.
Analogy: Imagine a tree of building blocks where each block is a letter. To build the tallest tower (longest word), every smaller tower below it must also be complete and stable (valid word).
root ↓ a -> p -> p -> l -> e ↑ ↑ ↑ ↑ ↑ w w w w w w = word ends here (valid word)
