feat: take a stab on day 9 part 2

This commit is contained in:
Jacob Jonsson 2026-01-08 01:10:54 +01:00
parent 0ab5abe6ba
commit 55f6a89cbb
No known key found for this signature in database
GPG key ID: E82A449642FD9CED

View file

@ -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"