3355. Zero Array Transformation I
You are given an integer array
numsof lengthnand a 2D arrayqueries, wherequeries[i] = [li, ri].For each
queries[i]:
- Select a subset of indices within the range
[li, ri]innums.- Decrement the values at the selected indices by 1.
A Zero Array is an array where all elements are equal to 0.
Return
trueif it is possible to transformnumsinto a Zero Array after processing all the queries sequentially, otherwise returnfalse.A subset of an array is a selection of elements (possibly none) of the array.
1 | class Solution { |