Repeated String Match Description link Solution 只能是1次或者2次 Code O(n) class Solution: def repeatedStringMatch(self, A: str, B: str) -> int: times = -(-len(B) // len(A)) for i in range(2): if B in A*(times + i): return times + i return -1