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存在
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存在