About the code The maximum sum subarray problem is the task of finding a contiguous subarray with the largest sum, within a given one-dimensional array A[1...n] of numbers. Read more: wiki
Pseudo Code
for(each element in array):
max_ending_here = max_ending_here + a[i]
if(max_ending_here < a[i])
max_ending_here = a[i]
if(max_so_far < max_ending_here)
max_so_far = max_ending_here
return max_so_far
My problem
This algo is little modified to work for negative integer and that modification is that the max_so_far
variable should be initialized with INT_MIN but i cannot find a way to do so in Python