14 lines
272 B
Python
14 lines
272 B
Python
# Time: O(NlogN)
|
|
# Space: O(1)
|
|
|
|
from collections import Counter
|
|
|
|
class Solution:
|
|
def isAnagram(self, s: str, t: str) -> bool:
|
|
slen, tlen = len(s), len(t)
|
|
|
|
if slen != tlen:
|
|
return False
|
|
|
|
return sorted(s) == sorted(t)
|