没看答案。
class Solution:
def repeatedSubstringPattern(self, s: str) -> bool:
n = len(s)
for i in range(1, n//2+1):
tmp = s[:i]
if tmp*(n//i) == s:
return True
return False
没看答案。
class Solution:
def repeatedSubstringPattern(self, s: str) -> bool:
n = len(s)
for i in range(1, n//2+1):
tmp = s[:i]
if tmp*(n//i) == s:
return True
return False