-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
💬 문제
[코딩테스트 연습 - 부족한 금액 계산하기](https://school.programmers.co.kr/learn/courses/30/lessons/82612)
💬 풀이
func solution(price:Int, money:Int, count:Int) -> Int64 {
let p = Int64((1...count).map({ $0 * price }).reduce(0, +))
return Int64(money) > p ? 0 : p - Int64(money)
}