Implement a Trie with insert, search, and startsWith methods.
Search returns True only if the word exists AND was inserted (is_end=True). StartsWith returns True if any word starts with the prefix.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
t.search('apple')
True
t.search('app')
False
t.startsWith('app')
True
t.search('app')
True