From 1f177db7f118ede6652b7217de5e8d9fcbe1ce2e Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 29 Feb 2024 19:51:08 +0100 Subject: ocaml(day4): fix map-filter --- 2023/ocaml/day4/bin/main.ml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to '2023/ocaml/day4') diff --git a/2023/ocaml/day4/bin/main.ml b/2023/ocaml/day4/bin/main.ml index 9d1a6ad..fdc3553 100644 --- a/2023/ocaml/day4/bin/main.ml +++ b/2023/ocaml/day4/bin/main.ml @@ -30,11 +30,7 @@ let rec parse ?(result = 0) lines = let k = Int.shift_left 1 - (List.length - (List.map - (fun win -> if List.mem win plays = true then 1 else 0) - winnings - |> List.filter (fun i -> i = 1)) + (List.length (List.filter (fun win -> List.mem win plays) winnings) - 1) in -- cgit v1.2.3-18-g5258