We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
For add, the algorithm just builds the Trie h-a-c-k-a-t-h-o-n.
For find, let's say we're trying to find "h", well it starts at the root of the Trie and searches from there, so it doesn't start at the 2nd h.
Tries: Contacts
You are viewing a single comment's thread. Return to all comments →
For add, the algorithm just builds the Trie h-a-c-k-a-t-h-o-n.
For find, let's say we're trying to find "h", well it starts at the root of the Trie and searches from there, so it doesn't start at the 2nd h.
HackerRank solutions.