Consider current starting point as a subarray and update minimum sum and subarray indexes
curr_sum = arr [ i ] NEW_LINE if ( min_sum > abs ( curr_sum ) ) : NEW_LINE INDENT min_sum = abs ( curr_sum ) NEW_LINE start = i NEW_LINE end = i NEW_LINE DEDENT