From 55f6a89cbb15a2972744d8525f3c7d275806a4bf Mon Sep 17 00:00:00 2001 From: Jacob Jonsson Date: Thu, 8 Jan 2026 01:10:54 +0100 Subject: [PATCH] feat: take a stab on day 9 part 2 --- app/Day9.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Day9.hs b/app/Day9.hs index 6f61681..0d1aad3 100644 --- a/app/Day9.hs +++ b/app/Day9.hs @@ -1,6 +1,8 @@ module Main where import Data.List (uncons) +import Data.Map.Strict (Map) +import Data.Map.Strict qualified as M import Data.Maybe (mapMaybe) import Data.Set (Set) import Data.Set qualified as S @@ -38,6 +40,14 @@ combine as = S.toList $ foldl' (go as) S.empty as part1 :: String -> Int part1 = maximum . map (uncurry area) . combine . parse +-- | Idea: The red tiles form corners in a shape where the green tiles +-- are the walls. In order to be able to create a rectangle the +-- opposite tiles needs to be "visible" to each other, i.e. there +-- cannot be a wall tile in the way. +-- +-- Create the shape, for each red tile create a beam to every other +-- red tile, if they are unobstructed store the area. Pick the +-- greatest area. part2 :: String -> Int part2 = error "Not implemented"