Can you explain maximum subarry sum2.The logic after cumulative sum
The logic is cant understand
Hey @kireeti_kesani
After creating cumulativesum array
We run two loops where outer array is use to set starting point of the sub array and inner loop is used to set ending point of the array
Now cum_sum[J] HOLDS sum till jth index and cum_sum[I] holds sum till ith index
Then sum of subarray from i to j is cumsum[J]-cumsum[I]
And we maximize this for different i,j pairs
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.