codewars: solve 'sum of positive' challenge

This commit is contained in:
Ivan R. 2024-02-20 00:49:54 +05:00
parent 9951704e30
commit 87d77ce5b2
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C

View file

@ -0,0 +1,2 @@
let positive_sum ls =
List.fold_left ( + ) 0 (List.filter (fun x -> x > 0) ls);;