Greatest subsequential sum: Difference between revisions
→{{header|Quackery}}: improved efficiency
(Added Quackery.) |
(→{{header|Quackery}}: improved efficiency) |
||
Line 3,098:
=={{header|Quackery}}==
<syntaxhighlight lang="Quackery"> [ stack ] is maxseq ( --> s )
[ stack ] is maxsum ( --> s )
[ 0 swap witheach + ] is sum ( --> s )▼
[ [] maxseq put
0 maxsum put
dup dup size times
[
over maxseq replace ] ]
2drop behead drop dup ]
maxsum take
witheach
[ dup
|