Consider current starting point as a subarray and update minimum sum and subarray indexes
int curr_sum = arr [ i ] ; if ( min_sum > abs ( curr_sum ) ) { min_sum = abs ( curr_sum ) ; start = i ; end = i ; }