Water collected between towers: Difference between revisions

Content added Content deleted
Line 904: Line 904:
towerPools :: [Int] -> [(Int, Int)]
towerPools :: [Int] -> [(Int, Int)]
towerPools =
towerPools =
zipWith min . scanl1 max <*> scanr1 max >>= zipWith (((,) <*>) . (-))
zipWith min . scanl1 max <*> scanr1 max >>= zipWith ((<*>) (,) . (-))


main :: IO ()
main :: IO ()