Skip to content

Commit d4261cd

Browse files
authored
Update rotate-string.py
1 parent 3b80375 commit d4261cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/rotate-string.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def getPrefix(pattern):
101101

102102
if len(A) != len(B):
103103
return False
104-
return strStr(A * 2, B) != -1
104+
return strStr(A*2, B) != -1
105105

106106

107107
# Time: O(n^2)
@@ -113,4 +113,4 @@ def rotateString(self, A, B):
113113
:type B: str
114114
:rtype: bool
115115
"""
116-
return len(A) == len(B) and B in A + A
116+
return len(A) == len(B) and B in A*2

0 commit comments

Comments
 (0)