func solution(_ n:Int) -> Int {
if n == 0 { return 0 }
var result = [Int]()
for i in 1...n {
if n % i == 0 {
result.append(i)
}
}
return result.reduce(0) { $0 + $1 }
}
func solution(_ n:Int) -> Int {
return n != 0 ? (1...n).filter { n % $0 == 0 }.reduce(0, +) : 0
}