leftSum and rightSum, of the same length as the input array nums.leftSum such that leftSum[i] contains the sum of elements from nums[0] to nums[i].rightSum in a similar manner but in reverse, starting from the end of the array.leftSum[i-1] and rightSum[i+1] for each index i.i as the middleIndex.-1.