796. Rotate String
Easy
π Solution
class Solution:
def rotateString(self, A: str, B: str) -> bool:
if not A and not B:
return True
for i in range(1,len(A)):
temp = A[i:] + A[:i]
if temp == B:
return True
return FalseLast updated