What is the easiest (best) way to find the sum of an array of integers in swift? I have an array called multiples and I would like to know the sum of the multiples.
This also works:
let arr = [1,2,3,4,5,6,7,8,9,10] var sumedArr = arr.reduce(0, combine: {$0 + $1}) print(sumedArr)
The result will be: 55