Medium Accuracy: 37.58%
Submissions: 2117 Points: 4
Given a string ‘s’, the task is to check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.
Input: s = "ababab"
Explanation: It is contructed by
appending "ab" 3 times
Input: s = "ababac"
Explanation: Not possible to construct
Your task is to complete the function isRepeat() which takes a single string as input and returns 1 if possible to construct, otherwise 0. You do not need to take any input or print anything.
Expected Time Complexity: O(|s|) Expected Auxiliary Space: O(|s|)