Dashboard Temp Share Shortlinks Frames API

HTMLify

LeeCode - Rotate String - Python
Views: 383 | Author: abh
1
2
3
4
5
6
7
8
class Solution:
    def rotateString(self, s: str, goal: str) -> bool:
        for _ in range(len(s)):
            s = s[1:] + s[0]
            print(s)
            if s == goal:
                return True
        return False