see 28th line of code when i=0
then 35th line of code currentsum=cumsum[j]-cum[i-1]
if i=0 then i-1=-1 which will generate an error
maximum subarray sum-2 corner case
@Tribhav_Chaudhary hey tribhav you can see that prateek bhaiya already captured value of cumSum of i=0 at line 19 so it will not give any error
i am not saying that cumsum will not capture the value of i=0.
i am saying that in line 35 the index of cumsum for i=0 will become -1 that will lead to wrong results.
@Tribhav_Chaudhary hey tribhav you are absolutely right there is an error in the video it will rectify soon the correct solution of the code you can refer this.