From 87d77ce5b2ca035265d544046110270fed1cb1f2 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Tue, 20 Feb 2024 00:49:54 +0500 Subject: [PATCH] codewars: solve 'sum of positive' challenge --- codewars/ocaml/sum-of-positive/main.ml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 codewars/ocaml/sum-of-positive/main.ml diff --git a/codewars/ocaml/sum-of-positive/main.ml b/codewars/ocaml/sum-of-positive/main.ml new file mode 100644 index 0000000..fc980ec --- /dev/null +++ b/codewars/ocaml/sum-of-positive/main.ml @@ -0,0 +1,2 @@ +let positive_sum ls = + List.fold_left ( + ) 0 (List.filter (fun x -> x > 0) ls);;