given a nonempty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together for example input abab output true explanation it s the substring ab twice input aba output false input abcabcabcabc output true explanation it s the substring abc four times reference https leetcode comproblemsrepeatedsubstringpatterndescription type s str rtype bool type s str rtype bool
def repeat_substring(s):
    
    str = (s + s)[1:-1]
    return s in str