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 620b3dd commit 35df9c2Copy full SHA for 35df9c2
valid-anagram/Donghae0230.py
@@ -0,0 +1,13 @@
1
+class Solution:
2
+ def isAnagram(self, s: str, t: str) -> bool:
3
+ s_list = sorted(list(s))
4
+ t_list = sorted(list(t))
5
+ # 1. 두 단어의 길이가 다른 경우 false 반환
6
+ if len(s_list) != len(t_list):
7
+ return False
8
+ else:
9
+ # 2. 각 알파벳의 순서가 일치하지 않는 경우 false 반환
10
+ for i in range(0, len(s_list)):
11
+ if s_list[i] != t_list[i]:
12
13
+ return True
0 commit comments