Greatest subsequential sum: Difference between revisions

Content added Content deleted
Line 90: Line 90:
=={{header|AppleScript}}==
=={{header|AppleScript}}==


Deriving both sum and list in a single fold:
Linear derivation of both sum and list in a single fold:
<lang applescript>-- maxSubseq :: [Int] -> [Int] -> (Int, [Int])
<lang applescript>-- maxSubseq :: [Int] -> [Int] -> (Int, [Int])
on maxSubseq(xs)
on maxSubseq(xs)