From f271e93e635897c534b2c1479bdb2b35bb635ad6 Mon Sep 17 00:00:00 2001 From: Matthew Gretton-Dann Date: Mon, 16 Dec 2024 15:22:04 +0000 Subject: [PATCH] Remove redundant line of code --- bin/day2416.ml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/day2416.ml b/bin/day2416.ml index a5bd505..21c4cd8 100644 --- a/bin/day2416.ml +++ b/bin/day2416.ml @@ -119,9 +119,7 @@ let part2 (grid, start_pos) = let rec impl acc lst = match dijkstra (visit_max grid visited_grid) (check_end grid) lst with | None -> acc - | Some (_, states, remainder) -> - List.iter (fun x -> visited_grid.(visited_idx grid x) <- 0) states; - impl (states :: acc) remainder + | Some (_, states, remainder) -> impl (states :: acc) remainder in impl [] [ (0, [ ((1, 0), start_pos) ]) ] |> List.concat |> List.map snd |> List.sort_uniq compare |> List.length