Repeated Sub-String Pattern

Published by Mubashir Hassan in

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.

Watch a quick demo on how Edabit works.