请教一道google的数组遍历题# JobHunting - 待字闺中
k*r
1 楼
2. Given a list of words, find two strings S & T such that:
a. S & T have no common character
b. S.length() * T.length() is maximized
刚从板上看到这题, 我能想到的就是greedy search解法, 都需要O(n^2 * l), n是单
词个数, l是单词平均字母数
这题怎么才能做得比O(n^2)更快
a. S & T have no common character
b. S.length() * T.length() is maximized
刚从板上看到这题, 我能想到的就是greedy search解法, 都需要O(n^2 * l), n是单
词个数, l是单词平均字母数
这题怎么才能做得比O(n^2)更快