TriesImplement Trie (Prefix Tree)
Progress
solution.py
⌘↵ run
Loading...

Implement Trie (Prefix Tree)

medium
You've got this! Start small, think out loud.

Implement a Trie with `insert(word)`, `search(word)` (returns true if word exists), and `startsWith(prefix)` (returns true if any word has this prefix) methods.

Time:O(m) per op
Space:O(n * m)
triedesigngoogle-favorite
OUTPUT

Run your code to see output