Greatest subsequential sum: Difference between revisions
m
→{{header|Sidef}}: replaced `.each_with_index` with `.each_kv`
m (→{{header|Sidef}}: replaced `.each_with_index` with `.each_kv`) |
|||
Line 2,729:
<lang ruby>func maxsubseq(*a) {
var (start, end, sum, maxsum) = (-1, -1, 0, 0);
a.
sum += x;
if (maxsum < sum) {
|