import Foundation
func solution(_ left:Int, _ right:Int) -> Int {
var count = 0
var result = 0
for n in left...right {
count = 0
for i in 1...n {
if n % i == 0 {
count += 1
}
}
count % 2 == 0 ? result += n : result += -n
}
return result
}
func solution(_ left: Int, _ right: Int) -> Int {
return (left...right).map { i in (1...i).filter { i % $0 == 0 }.count % 2 == 0 ? i : -i }.reduce(0, +)
}