programmers.co.kr/learn/courses/30/lessons/76501?language=swift 나의 풀이 import Foundation func solution(_ absolutes:[Int], _ signs:[Bool]) -> Int { return zip(absolutes, signs).map { i, bool in if bool == false { return i * -1 } return i }.reduce(0, +) } 다른 사람의 풀이 import Foundation func solution(_ absolutes:[Int], _ signs:[Bool]) -> Int { var answer = 0 for i in 0..
programmers.co.kr/learn/courses/30/lessons/12982?language=swift 나의 풀이 import Foundation func solution(_ d:[Int], _ budget:Int) -> Int { var arr: [Int] = d.sorted() var budget: Int = budget while let min = arr.first, budget >= min { budget -= arr.removeFirst() } return d.count - arr.count } 다른 사람의 풀이 import Foundation func solution(_ d:[Int], _ budget:Int) -> Int { var budget = budget return d.so..