KMP 算法先跳过
思路:用了拼接字符串去掉首位的思路
class Solution(object):
def repeatedSubstringPattern(self, s):
"""
:type s: str
:rtype: bool
"""
n=len(s)
if n<=1:
return False
ss=s[1:]+s[:-1]
print(ss.find(s))
return ss.find(s)!=-1