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 d0d1fb8 commit f8213bcCopy full SHA for f8213bc
valid-anagram/gmlwls96.kt
@@ -0,0 +1,8 @@
1
+class Solution {
2
+ // 시간 복잡도 : O(nlog(n))
3
+ fun isAnagram(s: String, t: String): Boolean {
4
+ val sortS = s.toCharArray().apply { sort() } // string을 char array로 변환 후 정렬.
5
+ val sortT = t.toCharArray().apply { sort() }
6
+ return sortS.concatToString() == sortT.concatToString() // 정렬된 char array를 string으로 만든후 비교.
7
+ }
8
+}
0 commit comments