You are using an outdated browser. Please update your browser for a better user experience.

Implement Trie Prefix Tree

string

Implement a trie with insert, search, and startsWith methods. You may assume that all inputs are consist of lowercase letters a-z. All inputs are guaranteed to be non-empty strings.

Example:

Trie trie = new Trie();

trie.insert("apple");

trie.search("apple"); // returns true

trie.search("app"); // returns false

trie.startsWith("app"); // returns true

trie.insert("app");

trie.search("app"); // returns true

To Start: