Prerequisites:
Strings in Python | Python | Castor Classes
Strings in Python | Part 2 | Castor Classes
Code:
class Solution:
def rotateString(self, A: str, B: str) -> bool:
if(len(A)!=len(B)):
return False;
else:
A=A+A;
if( B in A):
return True;
else:
return False;
Strings in Python | Python | Castor Classes
Strings in Python | Part 2 | Castor Classes
Code:
class Solution:
def rotateString(self, A: str, B: str) -> bool:
if(len(A)!=len(B)):
return False;
else:
A=A+A;
if( B in A):
return True;
else:
return False;
0 Comments:
Post a Comment