Skip to content

Commit 3272e7f

Browse files
committed
Solutuion Anagram
1 parent 9ede0c0 commit 3272e7f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

valid-anagram/HISEHOONAN.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// 218.swift
3+
// Algorithm
4+
//
5+
// Created by 안세훈 on 4/8/25.
6+
//
7+
8+
//Valid Anagram
9+
class Solution {
10+
func isAnagram(_ s: String, _ t: String) -> Bool {
11+
var sortS = s.sorted() //s를 sort하여 sortS에 저장
12+
var sortT = t.sorted() //t를 sort하여 sortT에 저장
13+
14+
return sortS == sortT ? true : false //sortS와 sortT가 같다면 true 아니면 false
15+
}
16+
}

0 commit comments

Comments
 (0)