Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3d8c9b commit 97aed5aCopy full SHA for 97aed5a
Arrays/isAnagram.py
@@ -0,0 +1,12 @@
1
+class Solution:
2
+ def isAnagram(self, s: str, t: str) -> bool:
3
+ _len = len(s)
4
+ _len2 = len(t)
5
+ if _len != _len2:
6
+ return False
7
+ _list = [0 for i in range(26)]
8
+ _list2 = [0 for i in range(26)]
9
+ for i in range(_len):
10
+ _list[ord(s[i])-ord('a')] += 1
11
+ _list2[ord(t[i])-ord('a')] += 1
12
+ return tuple(_list) == tuple(_list2)
0 commit comments