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 |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 1796. Second Largest Digit in a String (0) | 2022.04.18 |
---|---|
leetcode 1154. Day of the Year (0) | 2022.04.18 |
leetcode 202. Happy Number (0) | 2022.04.18 |
leetcode 1903. Largest Odd Number in String (0) | 2022.04.14 |
leetcode 387. First Unique Character in a String (0) | 2022.04.14 |
댓글