Skip to content

Commit a103397

Browse files
authored
Merge pull request #1746 from devyejin/main
[devyejin] WEEK 02 solutions
2 parents 590313c + 2dd7074 commit a103397

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

valid-anagram/devyejin.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from collections import Counter
2+
class Solution(object):
3+
def isAnagram(self, s, t):
4+
# return Counter(s) == Counter(t)
5+
6+
# str에서 제공하는 count 함수 활용
7+
if len(s) != len(t):
8+
return False
9+
for i in set(s):
10+
if s.count(i) != t.count(i):
11+
return False
12+
return True
13+
14+

0 commit comments

Comments
 (0)