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

剑指 Offer II 063. 替换单词 更多...

class  Solution
 
struct  TrieNode
 

函数

 TEST (UhWRSj, case1)
 
 TEST (UhWRSj, case2)
 
 TEST (UhWRSj, case3)
 
 TEST (UhWRSj, case4)
 
 TEST (UhWRSj, case5)
 

详细描述

剑指 Offer II 063. 替换单词

函数说明

◆ TEST() [1/5]

leetcode::UhWRSj::TEST ( UhWRSj  ,
case1   
)

在文件 leetcode_test.cpp857 行定义.

857 {
858 string input[] = {"cat", "bat", "rat"};
859 auto vec = vector(begin(input), end(input));
860 ASSERT_EQ("the cat was rat by the bat", Solution::replaceWords(vec, "the cattle was rattled by the battery"));
861 }
int vec[100010]
Definition: pat.cpp:5095

引用了 leetcode::UhWRSj::Solution::replaceWords() , 以及 pat::a::a7_2::vec.

◆ TEST() [2/5]

leetcode::UhWRSj::TEST ( UhWRSj  ,
case2   
)

在文件 leetcode_test.cpp863 行定义.

863 {
864 string input[] = {"a", "b", "c"};
865 auto vec = vector(begin(input), end(input));
866 ASSERT_EQ("a a b c", Solution::replaceWords(vec, "aadsfasf absbs bbab cadsfafs"));
867 }

引用了 leetcode::UhWRSj::Solution::replaceWords() , 以及 pat::a::a7_2::vec.

◆ TEST() [3/5]

leetcode::UhWRSj::TEST ( UhWRSj  ,
case3   
)

在文件 leetcode_test.cpp869 行定义.

869 {
870 string input[] = {"a", "aa", "aaa", "aaaa"};
871 auto vec = vector(begin(input), end(input));
872 ASSERT_EQ("a a a a a a a a bbb baba a", Solution::replaceWords(vec, "a aa a aaaa aaa aaa aaa aaaaaa bbb baba ababa"));
873 }

引用了 leetcode::UhWRSj::Solution::replaceWords() , 以及 pat::a::a7_2::vec.

◆ TEST() [4/5]

leetcode::UhWRSj::TEST ( UhWRSj  ,
case4   
)

在文件 leetcode_test.cpp875 行定义.

875 {
876 string input[] = {"catt", "cat", "bat", "rat"};
877 auto vec = vector(begin(input), end(input));
878 ASSERT_EQ("the cat was rat by the bat", Solution::replaceWords(vec, "the cattle was rattled by the battery"));
879 }

引用了 leetcode::UhWRSj::Solution::replaceWords() , 以及 pat::a::a7_2::vec.

◆ TEST() [5/5]

leetcode::UhWRSj::TEST ( UhWRSj  ,
case5   
)

在文件 leetcode_test.cpp881 行定义.

881 {
882 string input[] = {"ac", "ab"};
883 auto vec = vector(begin(input), end(input));
884 ASSERT_EQ("it is ab that this solution is ac", Solution::replaceWords(vec, "it is abnormal that this solution is accepted"));
885 }

引用了 leetcode::UhWRSj::Solution::replaceWords() , 以及 pat::a::a7_2::vec.