OJ lintcode 最长单词

给一个词典,找出其中所有最长的单词。
您在真实的面试中是否遇到过这个题?
Yes
样例
在词典
{
"dog",
"google",
"facebook",
"internationalization",
"blabla"
}
中, 最长的单词集合为 ["internationalization"]
在词典
{
"like",
"love",
"hate",
"yes"
}
中,最长的单词集合为 ["like", "love", "hate"]

class Solution {
public:
    /**
     * @param dictionary: a vector of strings
     * @return: a vector of strings
     */
    vector longestWords(vector &dictionary) {
        // write your code here
        vector max;

        int temp=0;

        for(int i=0;i

你可能感兴趣的:(OJ lintcode 最长单词)