At 01:50 how is that array made?And can u please explain it once I have not understood this method
Doubt in cumulative sum
@supratik260699 A cumulative sum is a sequence of partial sums of a given sequence. Let the cumulative sum array be:
2 6 11 17 25 This is the array which contains sum of all array elements upto 0th index at 0th pos, sum of all array elements upto 1st index at 1st position and so on…
Consider an array:
2 4 5 6 8
Now cumulative sum array:
2 2+4 2+4+5…
which is 2 6 11 17 25
1 Like
the given array is {-2, -5, 6, -2, -3, 1, 5, -6}, then the maximum subarray sum is 7
Its given in the question how is the maximum subarray is 7?
Here maximum subarray sum is formed by 6,-2,-3,1,5 which comes out as 7.