Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (13 sloc) 298 Bytes
class Solution:
def repeatedStringMatch(self, A, B):
"""
:type A: str
:type B: str
:rtype: int
"""
n = (len(B) - 1) // len(A) + 1
if B in A * n:
return n
if B in A * (n + 1):
return n + 1
return -1