feat: take a stab on day 9 part 2
This commit is contained in:
parent
0ab5abe6ba
commit
55f6a89cbb
1 changed files with 10 additions and 0 deletions
10
app/Day9.hs
10
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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue