#C4422. Repeated Substring Pattern
Repeated Substring Pattern
Repeated Substring Pattern
Given a string s, determine if it can be constructed by taking one of its substrings and appending multiple copies of that substring together.
For example, the string "abab" can be formed by repeating "ab", so the answer is True, whereas "aba" cannot and the answer is False.
Constraints: \(1 \leq |s| \leq 10^4\).
inputFormat
The input consists of a single line containing the string s.
outputFormat
Output a single line: True
if the string can be constructed by repeating a substring, otherwise False
.
abab
True