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 f445f71 commit 8ce8f25Copy full SHA for 8ce8f25
valid-anagram/EstherKim97.py
@@ -0,0 +1,20 @@
1
+class Solution(object):
2
+ def isAnagram(self, s, t):
3
+ character1 = []
4
+ character2 = []
5
+
6
+ # put characters in character1 and character2
7
+ for i in s:
8
+ character1.append(i)
9
+ for i in t:
10
+ character2.append(i)
11
12
+ # sort out the characters in alphabetical order
13
+ character1.sort()
14
+ character2.sort()
15
16
+ # compare each characters to see if they match (= anagram)
17
+ if character1 == character2:
18
+ return True
19
+ else:
20
+ return False
0 commit comments