2022-11-03 08:27:54 +00:00
|
|
|
#include "s0014_longest_common_prefix.hpp"
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
TEST(Problem14, Case1) {
|
|
|
|
vector<string> i{"flower","flow","flight"};
|
|
|
|
string o{"fl"};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0014 solution;
|
2022-11-03 08:27:54 +00:00
|
|
|
EXPECT_EQ(solution.longestCommonPrefix(i), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem14, Case2) {
|
|
|
|
vector<string> i{"dog","racecar","car"};
|
|
|
|
string o{""};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0014 solution;
|
2022-11-03 08:27:54 +00:00
|
|
|
EXPECT_EQ(solution.longestCommonPrefix(i), o);
|
|
|
|
}
|