Repeated Substring Pattern

This commit is contained in:
2022-12-01 21:03:25 +08:00
parent 9ce930f11f
commit 8485bba8c0
5 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include "s0459_repeated_substring_pattern.hpp"
#include <gtest/gtest.h>
TEST(Problem459, Case1) {
string s{"abab"};
bool expected{true};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}
TEST(Problem459, Case2) {
string s{"aba"};
bool expected{false};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}
TEST(Problem459, Case3) {
string s{"abcabcabcabc"};
bool expected{true};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}
TEST(Problem459, Case4) {
string s{"abac"};
bool expected{false};
S0459 solution;
EXPECT_EQ(solution.repeatedSubstringPattern(s), expected);
}