The overall max sum is the sum of both parts minus the peak element , because it was counted twice .
int sum_all = sum_inc + sum_dec - arr [ j ] ; max_sum = max ( { max_sum , sum_inc , sum_dec , sum_all } ) ;