Kadnaes algorithm

If I have all the element present negative like -1,-2,-3,-4
then answer would be -1 but your code is returning as 0 .Please help me.

take the max_sum = INT_MIN
because INT_MIN is a very small number