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 cbe4aeb commit 2ed6480Copy full SHA for 2ed6480
โvalid-anagram/ohkingtaek.pyโ
@@ -0,0 +1,10 @@
1
+from collections import Counter
2
+
3
+class Solution:
4
+ def isAnagram(self, s: str, t: str) -> bool:
5
+ """
6
+ ๋ ๋ฌธ์์ด์ด anagram์ธ์ง ํ์ธํ๋ค.
7
+ Counter๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ๋ฌธ์์ด์ ๋ฌธ์ ๋น๋์๋ฅผ ๊ณ์ฐํ๊ณ ๋น๊ตํ๋ค.
8
+ ์๊ฐ๋ณต์ก๋ O(n), ๋ฌธ์์ด์ ํ ๋ฒ ์ํํ์ฌ ๋น๋์๋ฅผ ๊ณ์ฐ
9
10
+ return True if Counter(s) == Counter(t) else False
0 commit comments