Skip to content

Commit e121646

Browse files
committed
valid-anagram solution
1 parent cbe39c8 commit e121646

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

valid-anagram/ayleeee.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def is_anagram(s: str, t: str) -> bool:
2+
# return sorted(s) == sorted(t)
3+
'''
4+
Counter : 원소의 빈도수를 세는 자료구조, 한 번씩만 세면 됨
5+
= O(n)
6+
Sorted : O(nlogn)
7+
'''
8+
return Counter(s) == Counter(t)

0 commit comments

Comments
 (0)