From d2427d370c43ca58800f203a6b7dcbd5a815c5a8 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 11 Dec 2023 11:14:19 +0000 Subject: [PATCH] Added link to blog --- advent11/Main.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/advent11/Main.hs b/advent11/Main.hs index 283060d..cfdbe0e 100644 --- a/advent11/Main.hs +++ b/advent11/Main.hs @@ -1,4 +1,4 @@ --- Writeup at https://work.njae.me.uk/2023/12/10/advent-of-code-2023-day-10/ +-- Writeup at https://work.njae.me.uk/2023/12/11/advent-of-code-2023-day-11/ import AoC @@ -29,7 +29,8 @@ part2 galaxies = allDistances $ expandGalaxies galaxies (10^6) allDistances :: Galaxies -> Int allDistances gs = case S.minView gs of Nothing -> 0 - Just (g, gs') -> (S.foldl' (addDist g) 0 gs) + allDistances gs' + Just (g, gs') -> (S.foldl' ( + addDist g) 0 gs) + allDistances gs' where addDist g1 acc g2 = acc + distance g1 g2 distance :: Position -> Position -> Int -- 2.34.1