Repeated Substring Pattern
Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.
Example 1
Input
s = "abab"Output
trueIt is the substring "ab" twice.
Example 2
Input
s = "aba"Output
falseThe string cannot be constructed by repeating a smaller substring multiple times.
Constraints
- 1 <= s.length <= 10^4
- s consists of lowercase English letters.