Cumulative Sum for [-1]

The code that is being taught in this video, in that while generating all the subarrays the code is:
for ( int i = 0; i<n; i++) {
for (int j = i; j<n; j++) {
int currentSum = 0;
currentSum = cumSum[j] - cumSum[i-1];
Now for i = 0, wouldn’t cumSum[i-1] would cause issues as cumSum[-1] could be any garbage value??

It can create problem, so u can do things:

  1. make a different condition for i==0 or
  2. make all arrays 1 based indexing.