solution.py
⌘↵ runLoading...
Implement Trie (Prefix Tree)
mediumYou'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