Rep-string: Difference between revisions
Content added Content deleted
m (Minor improvement to code.) |
m (Minor improvement to code.) |
||
Line 990: | Line 990: | ||
std::vector<std::string> rep_string(const std::string& text) { |
std::vector<std::string> rep_string(const std::string& text) { |
||
std::vector<std::string> repetitions; |
std::vector<std::string> repetitions; |
||
if ( text.length() < 2 ) { |
|||
return repetitions; |
|||
} |
|||
for ( uint64_t len = 1; len <= text.length() / 2; ++len ) { |
for ( uint64_t len = 1; len <= text.length() / 2; ++len ) { |