📚 Problem
없는 숫자 더하기
💫 Solve
import Foundation
func solution(_ numbers:[Int]) -> Int {
var total : Int = 0
for i in numbers {
total += i
}
return 45 - total
}
🩺 Another Solution
import Foundation
func solution(_ numbers:[Int]) -> Int {
return 45-numbers.reduce(0, +)
}