← Back to challenges

Repeated Sub-String Pattern

PythonHardconditionsstringsvalidation

Instructions

Create a solution that checks if a given string consists of a sub-string pattern repeated multiple times to return True or False.

Examples

repeated("a") ➞ False

repeated("ababab") ➞ True

repeated("aba") ➞ False

repeated("abcabcabcabc") ➞ True

repeated("aaxxtaaxztaaxxt") ➞ False

Notes

Adroit programmers can solve this in one line.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.