Water collected between towers: Difference between revisions
Content added Content deleted
(added Factor) |
(→{{header|Factor}}: Wasn't aware of cumulative max word from math.statistics vocab; use that instead of rolling my own.) |
||
Line 703:
=={{header|Factor}}==
<lang factor>USING: formatting kernel math math.order
sequences ;
IN: rosetta-code.water-towers
Line 715 ⟶ 716:
{ 6 7 10 7 6 }
}
: area ( seq -- n )
[ min ] 2map swap [ - ] 2map sum ;
|