Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 155 Bytes

FirstFiveSumSolution.md

File metadata and controls

9 lines (7 loc) · 155 Bytes

First Five Sum Solution

Swift

func firstFiveEvenSum(in arr: [Int]) -> Int {
    return arr.filter{$0 % 2 == 0}.prefix(5).reduce(0, +)
}