LeetCode 5995. 字符串分组
更多...
|
| TEST (groups_of_strings, case1) |
|
| TEST (groups_of_strings, case2) |
|
| TEST (groups_of_strings, case3) |
|
| TEST (groups_of_strings, case4) |
|
| TEST (groups_of_strings, case5) |
|
◆ TEST() [1/5]
leetcode::groups_of_strings::TEST |
( |
groups_of_strings |
, |
|
|
case1 |
|
|
) |
| |
在文件 leetcode_test.cpp 第 1146 行定义.
1147 string input[] = {
"a",
"b",
"ab",
"cde"};
1148 auto input_vec = vector(begin(input), end(input));
1149 int output[] = {2, 3};
1150 const auto output_vec = vector(begin(output), end(output));
1151 auto sol = Solution();
1152 ASSERT_EQ(output_vec, sol.groupStrings(input_vec));
◆ TEST() [2/5]
leetcode::groups_of_strings::TEST |
( |
groups_of_strings |
, |
|
|
case2 |
|
|
) |
| |
在文件 leetcode_test.cpp 第 1155 行定义.
1156 string input[] = {
"a",
"ab",
"abc"};
1157 auto input_vec = vector(begin(input), end(input));
1158 int output[] = {1, 3};
1159 const auto output_vec = vector(begin(output), end(output));
1160 auto sol = Solution();
1161 ASSERT_EQ(output_vec, sol.groupStrings(input_vec));
◆ TEST() [3/5]
leetcode::groups_of_strings::TEST |
( |
groups_of_strings |
, |
|
|
case3 |
|
|
) |
| |
在文件 leetcode_test.cpp 第 1164 行定义.
1165 string input[] = {
"qamp",
"am",
"khdrn"};
1166 auto input_vec = vector(begin(input), end(input));
1167 int output[] = {3, 1};
1168 const auto output_vec = vector(begin(output), end(output));
1169 auto sol = Solution();
1170 ASSERT_EQ(output_vec, sol.groupStrings(input_vec));
◆ TEST() [4/5]
leetcode::groups_of_strings::TEST |
( |
groups_of_strings |
, |
|
|
case4 |
|
|
) |
| |
在文件 leetcode_test.cpp 第 1173 行定义.
1174 string input[] = {
"ghnv",
"uip",
"tenv",
"hvepx",
"e",
"ktc",
"byjdt",
"ulm",
"cae",
"ea"};
1175 auto input_vec = vector(begin(input), end(input));
1176 int output[] = {8, 3};
1177 const auto output_vec = vector(begin(output), end(output));
1178 auto sol = Solution();
1179 ASSERT_EQ(output_vec, sol.groupStrings(input_vec));
◆ TEST() [5/5]
leetcode::groups_of_strings::TEST |
( |
groups_of_strings |
, |
|
|
case5 |
|
|
) |
| |
在文件 leetcode_test.cpp 第 1182 行定义.
1183 string input[] = {
"web",
"a",
"te",
"hsx",
"v",
"k",
"a",
"roh"};
1184 auto input_vec = vector(begin(input), end(input));
1185 int output[] = {5, 4};
1186 const auto output_vec = vector(begin(output), end(output));
1187 auto sol = Solution();
1188 ASSERT_EQ(output_vec, sol.groupStrings(input_vec));