leetcode/0242_valid-anagram/python3/oneliner.py

9 lines
166 B
Python

# Time: O(N)
# Space: O(N)
from collections import Counter
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
return Counter(s) == Counter(t)