FunctionRacerProblemsRace

Repeated Substring Pattern

EasyStringsPython, JavaScript, TypeScript, Java, C++

Return True if s can be built by taking some shorter non-empty piece of it and writing that piece two or more times in a row, otherwise False.

Example 1

s "abab"
returns true

ab written twice.

Example 2

s "aba"
returns false

No shorter piece repeats to make it.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems