Repeated Substring Pattern
Given a string s, return true if it can be constructed by taking some substring of it and concatenating multiple (two or more) copies of that substring together.
Open official problem prompt ↗Decide whether the whole string is just one smaller block copied end to end two or more times.
Like checking whether a bracelet pattern is one motif stamped repeatedly: rotate the bracelet by less than a full turn and see if it lands on itself.
- Input
- s = "abab"
- Output
- true
- Why
- "abab" is "ab" repeated twice.
1 <= s.length <= 10^4s consists of lowercase English letters