분류 전체보기
-
import Foundation func solution(_ seoul:[String]) -> String { return "김서방은 \(seoul.firstIndex(of: "Kim")!)에 있다" }
[Swift] 서울에서 김서방 찾기import Foundation func solution(_ seoul:[String]) -> String { return "김서방은 \(seoul.firstIndex(of: "Kim")!)에 있다" }
2023.02.14 -
import Foundation func solution(_ number:[Int]) -> Int { var result = 0 for i in 0..
[Swift] 삼총사import Foundation func solution(_ number:[Int]) -> Int { var result = 0 for i in 0..
2023.02.14 -
import Foundation func solution(_ price:Int, _ money:Int, _ count:Int) -> Int{ return max((count + 1) * count / 2 * price - money , 0) }
[Swift] 부족한 금액 계산하기import Foundation func solution(_ price:Int, _ money:Int, _ count:Int) -> Int{ return max((count + 1) * count / 2 * price - money , 0) }
2023.02.14 -
func solution(_ s:String) -> Int { return Int(s)! }
[Swift] 문자열 정수로 바꾸기func solution(_ s:String) -> Int { return Int(s)! }
2023.02.14 -
func solution(_ s:String) -> Bool { return (Int(s) != nil && (s.count == 4 || s.count == 6)) ? true : false }
[Swift] 문자열 다루기 기본func solution(_ s:String) -> Bool { return (Int(s) != nil && (s.count == 4 || s.count == 6)) ? true : false }
2023.02.14 -
import Foundation func solution(_ s:String) -> String { String(s.sorted(by: >)) }
[Swift] 문자열 내림차순으로 배치하기import Foundation func solution(_ s:String) -> String { String(s.sorted(by: >)) }
2023.02.14 -
import Foundation func solution(_ s:String) -> Bool { let string = s.lowercased() return string.components(separatedBy: "p").count == string.components(separatedBy: "y").count }
[Swift] 문자열 내 p와 y의 개수import Foundation func solution(_ s:String) -> Bool { let string = s.lowercased() return string.components(separatedBy: "p").count == string.components(separatedBy: "y").count }
2023.02.14 -
import Foundation func solution(_ strings:[String], _ n:Int) -> [String] { return strings.sorted { Array($0)[n] == Array($1)[n] ? $0 < $1 : Array($0)[n] < Array($1)[n] } }
[Swift] 문자열 내 마음대로 정렬하기import Foundation func solution(_ strings:[String], _ n:Int) -> [String] { return strings.sorted { Array($0)[n] == Array($1)[n] ? $0 < $1 : Array($0)[n] < Array($1)[n] } }
2023.02.14