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.
- Prepare
- Data Structures
- Trie
- Contacts
- Discussions
Contacts
Contacts
Sort by
recency
|
333 Discussions
|
Please Login in order to post a comment
C# solution using a tree where each node has potentially 26 children.
}
This is my solution for Python 3.5+ using dictionaries.
Simple java code using Trie -
class TrieNode{ TrieNode[] children = new TrieNode[26]; int we,prefix; public TrieNode(){ we=0; prefix=0; for(int i=0;i<26;i++) children[i]=null; } }
class Result {
} }
};
class Trie{ TrieNode *root;
};
vector contacts(vector> queries) { vector result; Trie *trie = new Trie();
}