Summation of both gives the maximum subarray sum after applying the operation
max_subarray_sum = Math . max ( max_subarray_sum , prefixSum [ i ] + kadane_r_to_l [ i + 1 ] ) ; } return max_subarray_sum ; }