Implement a trie with insert, search, and startsWith methods.
Example
1 | Trie trie = new Trie(); |
Note
- You may assume that all inputs are consist of lowercase letters a-z.
- All inputs are guaranteed to be non-empty strings.
Code
1 | public class TrieNode { |