HR F#: Sum of Odd Elements
The problem Sum of Odd Elements:
You are given a list. Return the sum of odd elements from the given list.
The solusion is basically just an invocation of the List.fold from the standard library:
let f arr =
arr
|> List.fold (fun s v -> if Math.Abs(v % 2) = 1 then s + v else s) 0
Math.Abs is required because for negative numbers % 2 returns either 0 or -1.