l********r 发帖数: 140 | 1 I recall saw it somewhere (maybe in CC150), but can't find it:
Given a collection of word, find the longest word that is made up from the
words in this collection.
Any idea? | l*n 发帖数: 529 | 2 https://github.com/rockcdr/Find-Longest-Word-Made-of-Other-Words/blob/master
/findLongest/main_rock.cpp
看起来是搞个trie,然后从最长开始挨个试,直到碰见能完全切开的。
【在 l********r 的大作中提到】 : I recall saw it somewhere (maybe in CC150), but can't find it: : Given a collection of word, find the longest word that is made up from the : words in this collection. : Any idea?
| x*****0 发帖数: 452 | |
|