avatar
share两道题目。# JobHunting - 待字闺中
c*n
1
1. Given an array of words find what is and how long is the length of the
longest common substring between two words in the array. Give best solution
and provide time complexity analysis.
2. Given a list of words output the largest anagram derivative contained in
that set. The definition of an anagram derivative is: Consider the word 'cat
' as a basis, then the word 'tack' is said to an anagram derivative of 'cat'
since it can be re-arranged and appended with an alphabet to form the word
'tack'. This process can be performed repeatedly, so that the word 'tacky'
is an anagram derivative of 'tack'.
Now given a list of words output the largest anagram derivative in that list.
题目1似乎可以用generalized suffix tree, 但是具体time compelxity不好给出来
题目2似乎从最长word开始往下减,看看看去一个字符后是否有anagram存在
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。