길이 값을 알아서, 해당 길이 / 해당 길이 + 1번의 횟수 안에 2번의 비교만으로 가능 (개선 가능)
class Solution(object):
def repeatedStringMatch(self, A, B):
"""
:type A: str
:type B: str
:rtype: int
"""
temp = ""
count = 0
while len(temp) < len(B):
temp+=A
count += 1
if B in temp:
return count
temp += A
if B in temp:
return count + 1
return -1