Find increasing subsequence with maximum sum. The DP tracks sum instead of length. = maximum sum of increasing subsequence ending at .
Base: . Transition: for all with . Example: . Max sum IS is with sum , not the longest with sum .
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Weighted LIS
Find increasing subsequence with maximum sum. The DP tracks sum instead of length. = maximum sum of increasing subsequence ending at .
Base: . Transition: for all with . Example: . Max sum IS is with sum , not the longest with sum .