2022-11-04 07:50:54 +00:00
|
|
|
#include "s0017_letter_combinations_of_a_phone_number.hpp"
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
TEST(Problem17, Case1) {
|
|
|
|
string i{"23"};
|
|
|
|
vector<string> o{"ad", "bd", "cd", "ae", "be", "ce", "af", "bf", "cf"};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0017 solution;
|
2022-11-04 07:50:54 +00:00
|
|
|
EXPECT_EQ(solution.letterCombinations(i), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem17, Case2) {
|
|
|
|
string i{""};
|
|
|
|
vector<string> o{};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0017 solution;
|
2022-11-04 07:50:54 +00:00
|
|
|
EXPECT_EQ(solution.letterCombinations(i), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem17, Case3) {
|
|
|
|
string i{"2"};
|
|
|
|
vector<string> o{"a", "b", "c"};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0017 solution;
|
2022-11-04 07:50:54 +00:00
|
|
|
EXPECT_EQ(solution.letterCombinations(i), o);
|
|
|
|
}
|