From 8b89ab12d3a1e7d0d271978debe9e78e206b7ce6 Mon Sep 17 00:00:00 2001 From: HJ Date: Sat, 18 Dec 2021 08:42:08 -0500 Subject: day 15 Elixir version --- 2021/day-15/day-15.livemd | 10 ---------- 1 file changed, 10 deletions(-) (limited to '2021') diff --git a/2021/day-15/day-15.livemd b/2021/day-15/day-15.livemd index da734ff..2495c32 100644 --- a/2021/day-15/day-15.livemd +++ b/2021/day-15/day-15.livemd @@ -279,16 +279,6 @@ We repeat the same steps as before: building the graph, using Dijkstra's algorithm and summing up the risks along the best path. ```elixir -get_lowest_risk_path = fn nodes -> - with {{min_c, _}, {max_c, _}} <- Enum.min_max_by(nodes, fn {{i, j}, _} -> i + j end) do - nodes - |> then(make_graph) - |> Graph.dijkstra(min_c, max_c) - |> tl() - |> Enum.reduce(0, fn coord, sum -> sum + Map.get(nodes, coord) end) - end -end - get_lowest_risk_path.(expanded_floor_nodes) ``` -- cgit v1.2.3