You are given two nums of length n and changeIndices of length m.
Initially, all indices in nums are unmarked.
At each second s from m, you can perform one of the following operations:
Choose an index i such that i n, and decrement nums[i] by
Set nums[changeIndices[s]] to
Choose an index i such that i n and nums[i] is equal to i.
Do nothing.
Return an integer representing the earliest second in the range nums can be marked, or
Constraints:
n nums.length
nums[i]
m changeIndices.length
changeIndices[i] n
You are given two nums of length n and changeIndices of length m.
Initially, all indices in nums are unmarked.
At each second s from m, you can perform one of the following operations:
Choose an index i such that i n, and decrement nums[i] by
Set nums[changeIndices[s]] to
Choose an index i such that i n and nums[i] is equal to i.
Do nothing.
Return an integer representing the earliest second in the range nums can be marked, or
Constraints:
n nums.length
nums[i]
m changeIndices.length
changeIndices[i] n