python-algorithm
leetcode 796. Rotate String
무적김두칠
2022. 4. 18. 16:05
1
2
3
4
5
6
7
8
|
class Solution:
def rotateString(self, s: str, goal: str) -> bool:
ans=False
for i in range(len(s)):
s=s[1:]+s[0]
if s == goal :
ans = True; break
return ans
|
cs |
반응형