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"