Skip to content

Commit 67299f4

Browse files
committed
feat: add 0218 Valid Anagram solution
1 parent e5950a9 commit 67299f4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

valid-anagram/hyogshin.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution:
2+
def isAnagram(self, s: str, t: str) -> bool:
3+
l = list(s)
4+
for d in t:
5+
if d in s and d in l:
6+
l.remove(d)
7+
else:
8+
return False
9+
10+
if not l:
11+
return True
12+
else:
13+
return False
14+

0 commit comments

Comments
 (0)