summaryrefslogtreecommitdiff
path: root/2023/ocaml/day4
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-02-29 19:51:08 +0100
committerSanto Cariotti <santo@dcariotti.me>2024-02-29 19:51:08 +0100
commit1f177db7f118ede6652b7217de5e8d9fcbe1ce2e (patch)
tree3e3bf135aae8a789c4a5910161e7b2021e321e60 /2023/ocaml/day4
parent52c33969d7b358cdac40f02a8562e37f82a96135 (diff)
ocaml(day4): fix map-filtermain
Diffstat (limited to '2023/ocaml/day4')
-rw-r--r--2023/ocaml/day4/bin/main.ml6
1 files changed, 1 insertions, 5 deletions
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