Handbook
Glossary
max-subarray-sum ( seq -- sum )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
Outputs
sum
an
object
Word description
Output the maximum subarray sum of the sequence.
Definition
USING:
kernel
math
math.order
;
IN:
sequences.extras
:
max-subarray-sum
( seq -- sum )
[
-1/0.
]
dip
[
[
+
]
keep
max
[
max
]
keep
]
0reduce
drop
;