3427. Sum of Variable Length Subarrays
You are given an integer array
numsof sizen. For each indexiwhere0 <= i < n, define a subarraynums[start ... i]wherestart = max(0, i - nums[i]).Return the total sum of all elements from the subarray defined for each index in the array.
1 | class Solution { |