题解 | 重复的子字符串
重复的子字符串
https://www.nowcoder.com/practice/9b921e9554b24d2e8e617cf8b77912c3
#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
#
# @param str string字符串
# @return bool布尔型
#
class Solution:
def repeatSubstring(self , str: str) -> bool:
# write code here
return (str*2).find(str,1)!=len(str)
#由于str可以有字串重复得到,则在下标序号为n之前就能开始匹配
