package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev
# README
720. Longest Word in Dictionary
Solution idea
Trie
思路总结
- 构造Trie树,然后使用 DFS 找到最深处就是最长的单词。注意:用
isEnd
标注一个TrieNode是否是一个单词的结尾。只有isEnd
为true
的节点才能继续往深处走。
Resource
wisdompeak/BreadcrumbsLeetCode/Trie/1858.Longest-Word-With-All-Prefixes
NOTE
Same question as 1858 - Longest Word With All Prefixes