given two strings a and b find the minimum number of times a has to be repeated such that b is a substring of it if no such solution return 1 for example with a abcd and b cdabcdab return 3 because by repeating a three times abcdabcdabcd b is a substring of it and b is not a substring of a repeated two times abcdabcd note the length of a and b will be between 1 and 10000 reference https leetcode comproblemsrepeatedstringmatchdescription
def repeat_string(A, B):
    count = 1
    tmp = A
    max_count = (len(B) / len(A)) + 1
    while not(B in tmp):
        tmp = tmp + A
        if (count > max_count):
            count = -1
            break
        count = count + 1

    return count