changeset 22:cbb6e979bbd5

Fix bug in max sum incr. subsequence
author Lewin Bormann <lbo@spheniscida.de>
date Thu, 02 Mar 2023 20:51:07 +0100
parents 4b24b380679d
children 41c00af82d66
files julia/dp.jl
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/julia/dp.jl	Thu Mar 02 20:48:26 2023 +0100
+++ b/julia/dp.jl	Thu Mar 02 20:51:07 2023 +0100
@@ -344,7 +344,7 @@
 end
 
 function max_sum_liss(v::AbstractVector{<:Integer}, i=1, last=v[begin], s=0)::Int
-    if i == length(v)
+    if i > length(v)
         return s
     else
         if v[i] >= last