Find the maximum subset sum in an array of numbers. Discuss complexity.
Anonymous
I assume you mean sub sequence, not subset. It can be solved in linear time but using a cumulative array instead of the original one. e.g. 4 8 -2 4 0 0 3 5 -30 12 4 12 10 14 14 14 17 22 -8 4 find the max number and the min number before that 4 - 22 the max sum sub sequence are between these indicies and max value is the max sum
Check out your Company Bowl for anonymous work chats.