Kadane 's Algorithm to find Minimum subarray sum.
curr_min = min ( curr_min + a [ i ] , a [ i ] ) NEW_LINE min_so_far = min ( min_so_far , curr_min ) NEW_LINE if ( min_so_far == sum ) : NEW_LINE return max_so_far NEW_LINE