LeetCode 208: Implement Trie Prefix Tree
Problem Restatement We need to implement a Trie, also called a prefix tree. The Trie must support three operations: Operation Meaning insert(word) Add word into the Trie search(word) Return True if the exact word exists startsWith(prefix) Return True if any inserted word starts with prefix The official problem asks us to implement the Trie class with insert , search , and startsWith . The Trie stores lowercase English words and...