Trie
Trie trie = new Trie();
for (String word : dict) {
trie.add(word);
}
class Trie {
TrieNode root;
public void add(String word) {
root.add(word);
}
}
class TrieNode {
char val;
Set<TrieNode> children;
TrieNode(char val) {
this.val = val;
this.children = new ArrayList<TrieNode>();
}
public void add(String word) {
char v = word.charAt(0);
if (children.contains(v)) {
}
}
}