programmers.co.kr/learn/courses/30/lessons/12903 나의 풀이 func solution(_ s:String) -> String { if s.count % 2 == 1 { return String(Array(s)[s.count/2]) } else { return String([Array(s)[s.count/2-1],Array(s)[s.count/2]]) } } 다른 사람의 풀이 func solution(_ s:String) -> String { return String(s[String.Index(encodedOffset: (s.count-1)/2)...String.Index(encodedOffset: s.count/2)]) } 배울 점 1. encodedOffset은 d..
programmers.co.kr/learn/courses/30/lessons/12901 나의 풀이 func solution(_ a:Int, _ b:Int) -> String { let week: [String] = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] let month: [Int] = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] var day: Int = b for i in 0.. String { let w = ["THU", "FRI", "SAT", "SUN", "MON", "TUE", "WED"] let monthDay = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31..