Files
advent-of-code-2023/day14/Part1.hs
2023-12-15 00:35:45 +01:00

12 lines
360 B
Haskell

module Part1 where
import Commons
import Data.Array (bounds, assocs)
getLoads :: Platform -> [Int]
getLoads platform =
let (yMax, _) = snd $ bounds platform
tiltedPlatform = tilt (-1, 0) (map fst $ filter (\ (_, r) -> r == Round) $ assocs platform) platform
in map (\ ((y, _), r) -> if r == Round then yMax + 1 - y else 0) $ assocs tiltedPlatform