Suppose we have two English strings s and t, they can be in lowercase and/or uppercase. We have to check whether one is a rotation of the other or not.
So, if the input is like s = "koLKAta" t = "KAtakoL", then the output will be True
To solve this, we will follow these steps −
Let us see the following implementation to get better understanding −
def solve(s, t): if len(s) != len(t): return False s = s + s return True if s.find(t) != -1 else False s = "koLKAta" t = "KAtakoL" print(solve(s, t))