Suppose we have two strings s and t we have to check whether they are anagram of each other or not.
So, if the input is like s = "bite" t = "biet", then the output will be True as s ad t are made of same characters.
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 = sorted(s) t = sorted(t) return s == t s = "bite" t = "biet" print(solve(s, t))