Skip to content

Commit eda96ad

Browse files
Create anagram1.py
1 parent 788e04e commit eda96ad

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

coding_interview/anagram1.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
class Solution:
3+
def isAnagram(self, s: str, t: str) -> bool:
4+
s = s.replace(" ","").lower()
5+
t = t.replace(" ","").lower()
6+
7+
return sorted(s) == sorted(t)

0 commit comments

Comments
 (0)