FreeCareerPath
Build the PrimitiveMedium

Implement Trie

Implement `Trie` with `insert(word)`, `search(word)` returning whether the exact word was inserted, and `starts_with(prefix)`. The one thing that separates a working trie from a broken one is marking end-of-word separately from having children. Insert "apple" and `search("app")` must be `False` while `starts_with("app")` is `True`.

What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.

Log in to start this session

Timed sessions and your results for "Implement Trie" are saved to your account — logging in takes a few seconds.

Implement Trie — FreeCareerPath