MCPcopy
hub / github.com/qiyuangong/leetcode / longestWord

Method longestWord

java/720_Longest_Word_in_Dictionary.java:22–30  ·  view source on GitHub ↗
(String[] words)

Source from the content-addressed store, hash-verified

20 }*/
21
22 public String longestWord(String[] words) {
23 Trie trie = new Trie();
24 int index = 0;
25 for (String word: words) {
26 trie.insert(word, ++index); //indexed by 1
27 }
28 trie.words = words;
29 return trie.dfs();
30 }
31}
32class Node {
33 char c;

Callers

nothing calls this directly

Calls 2

insertMethod · 0.95
dfsMethod · 0.95

Tested by

no test coverage detected