algorithm: kadane copy implemented from wiki + edge case handled, knapsack01 uses only last line