Solving Implement Trie Prefix Tree in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description


Trie trie = new Trie();

trie.insert("apple");"apple");   // returns true"app");     // returns false
trie.startsWith("app"); // returns true
trie.insert("app");"app");     // returns true


  • All inputs are guaranteed to be non-empty strings.

See the full details of the problem Implement Trie Prefix Tree at LeetCode

Originally posted at: