problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::longest_word_in_dictionary 命名空间参考

LeetCode 720. Longest Word in Dictionary 更多...

class  Solution
 

函数

 TEST (longest_word_in_dictionary, case1)
 
 TEST (longest_word_in_dictionary, case2)
 

详细描述

LeetCode 720. Longest Word in Dictionary

函数说明

◆ TEST() [1/2]

leetcode::longest_word_in_dictionary::TEST ( longest_word_in_dictionary  ,
case1   
)

在文件 leetcode_test.cpp2308 行定义.

2308 {
2309 vector<string> words = {"w", "wo", "wor", "worl", "world"};
2310 const string output = "world";
2311 ASSERT_EQ(output, Solution::longestWord(words));
2312 }

引用了 leetcode::longest_word_in_dictionary::Solution::longestWord().

◆ TEST() [2/2]

leetcode::longest_word_in_dictionary::TEST ( longest_word_in_dictionary  ,
case2   
)

在文件 leetcode_test.cpp2314 行定义.

2314 {
2315 vector<string> words = {"a", "banana", "app", "appl", "ap", "apply", "apple"};
2316 const string output = "apple";
2317 ASSERT_EQ(output, Solution::longestWord(words));
2318 }

引用了 leetcode::longest_word_in_dictionary::Solution::longestWord().