158. Valid Anagram
Description:
Write a method anagram(s,t) to decide if two strings are anagrams or not.
Example
Given s = “abcd”, t = “dcab”, return true.
Given s = “ab”, t = “ab”, return true.
Given s = “ab”, t = “ac”, return false.
Code:
class Solution:
"""
@param s: The first string
@param t: The second string
@return: true or false
"""
def anagram(self, s, t):
# write your code here
return sorted(s) == sorted(t)