由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 这道题怎么做?
相关主题
An interview question再来讨论一个题!
有人同看Longest Palindromic Substring 这道题么?一朋友被Google的电面干掉了 (转载)
这道题什么意识?找工作真是煎熬
GOOG phone interview question一道看似不难但难的题
Goldman Sachs 说了给offer一直下不来来道难一点的题
问一道amazon面试题这道题怎么做
Google onsite问题问一个老题 longest palindrome
[合集] 被这道题给放翻了大家看看这道题什么意思?我怎么不理解呢(C++)
相关话题的讨论汇总
话题: file话题: words话题: word话题: longest
进入JobHunting版参与讨论
1 (共1页)
l*****n
发帖数: 577
1
从cacreecup上看来的,amzon家的新题
Write a program that reads a file containing a sorted list of words (one
word per line, no spaces, all lower case), then identifies the longest word
in the file that can be constructed by concatenating copies of shorter words
also found in the file.
For example, if the file contained:
cat
cats
catsdogcats
catxdogcatsrat
dog
dogcatsdog
hippopotamuses
rat
ratcatdogcat
The answer would be 'ratcatdogcat' - at 12 letters, it is the longest word
made up of other words in the list.
s******n
发帖数: 3946
2
构造prefix tree,然后再匹配每个字串,匹配的过程用到DP(保存中间结果)
1 (共1页)
进入JobHunting版参与讨论
相关主题
大家看看这道题什么意思?我怎么不理解呢(C++)Goldman Sachs 说了给offer一直下不来
请问这道题怎么解问一道amazon面试题
大家看看这道题code怎么写Google onsite问题
这道题不会[合集] 被这道题给放翻了
An interview question再来讨论一个题!
有人同看Longest Palindromic Substring 这道题么?一朋友被Google的电面干掉了 (转载)
这道题什么意识?找工作真是煎熬
GOOG phone interview question一道看似不难但难的题
相关话题的讨论汇总
话题: file话题: words话题: word话题: longest