Skip to content

Commit 7a03f7d

Browse files
committed
add
1 parent 3b68493 commit 7a03f7d

File tree

1 file changed

+4
-1
lines changed
  • solutions/796. Rotate String

1 file changed

+4
-1
lines changed

solutions/796. Rotate String /796.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
def rotate_string(s: str, goal: str) -> bool:
2-
pass
2+
for i in range(len(s)):
3+
if s[i:] + s[:i] == goal:
4+
return True
5+
return False
36

47

58
print(rotate_string("abcde", "cdeab"))

0 commit comments

Comments
 (0)