Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
seq = -1,-2,3,5,6,-2,-1,4,-4,2,-1
|
||||
max := sum := start := 0
|
||||
Loop Parse, seq, `,
|
||||
If (max < sum+=A_LoopField)
|
||||
max := sum, a := start, b := A_Index
|
||||
Else If sum <= 0
|
||||
sum := 0, start := A_Index
|
||||
; read out the best subsequence
|
||||
Loop Parse, seq, `,
|
||||
s .= A_Index > a && A_Index <= b ? A_LoopField "," : ""
|
||||
MsgBox % "Max = " max "`n[" SubStr(s,1,-1) "]"
|
||||
Loading…
Add table
Add a link
Reference in a new issue