programmers.co.kr/learn/courses/30/lessons/77484 나의 풀이 import Foundation func solution(_ lottos:[Int], _ win_nums:[Int]) -> [Int] { let zeroCount = lottos.filter { $0 == 0}.count let winCount: Int = win_nums.filter { lottos.contains($0) }.count return [min(7-winCount-zeroCount,6), min(7-winCount,6)] }
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..