| ps | |
|---|---|
| 링크 | leetcode.com/… |
| 출처 | LeetCode |
| 문제 번호 | 242 |
| 문제명 | Valid Anagram |
| 레벨 | Easy |
| 분류 |
기초 |
| 시간복잡도 | O(n) |
| 인풋사이즈 | n<=5*10^4 |
| 사용한 언어 | python 3.14 |
| 제출기록 | 19.5MB / 3ms |
| 최고기록 | 0ms |
| 해결날짜 | 2026/04/24 |
"""Solution code for "LeetCode 242. Valid Anagram".
- Problem link: https://leetcode.com/problems/valid-anagram/
- Solution link: http://www.teferi.net/ps/problems/leetcode/242
"""
import collections
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
return collections.Counter(s) == collections.Counter(t)