Here in this maximum subarray sum 2 solution code, I think there is an issue in the code inside the two loops.
It is: currentSum = cumSum[j] - cumSum[i-1]
Actually here, when i value is 0, then it would be cumSum[-1] which is not defined and can give unpredictable results.
So, I just wanted to ask if I’m right with my doubt or there is something here that I’m missing. Also how should I fix it effectively.