You are given an integer array nums and a list of operations queries, where each operation queries[i] = [l_i, r_i, val_i].
For a fixed integer k, apply the first k operations in order. When applying an operation [l_i, r_i, val_i], you may choose for every index j in the range l_i to r_i an integer decrement d_j such that nums[j] = nums[j] - d_j.
After applying the first k operations, the array is called a zero array if every element is equal to
Return the minimum k such that it is possible to make nums a zero array after applying the first k operations. If it is impossible for any k, return
Note: In each operation, the decrement chosen at each index can be different, but it must be between
and val_iinclusive.
Constraints:
nums.length
nums[i]
queries.length
queries[i].length
l_i r_i nums.length
val_i
You are given an integer array nums and a list of operations queries, where each operation queries[i] = [l_i, r_i, val_i].
For a fixed integer k, apply the first k operations in order. When applying an operation [l_i, r_i, val_i], you may choose for every index j in the range l_i to r_i an integer decrement d_j such that nums[j] = nums[j] - d_j.
After applying the first k operations, the array is called a zero array if every element is equal to
Return the minimum k such that it is possible to make nums a zero array after applying the first k operations. If it is impossible for any k, return
Note: In each operation, the decrement chosen at each index can be different, but it must be between
and val_iinclusive.
Constraints:
nums.length
nums[i]
queries.length
queries[i].length
l_i r_i nums.length
val_i