Water collected between towers: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
Hout (talk | contribs)
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 ()