You are given two integer arrays nums and freq of length
At step i, freq[i] instances of the ID nums[i] are added to the collection if freq[i] is positive, or removed from the collection if freq[i] is negative.
Return an array ans of length ans[i] is the maximum frequency of any ID in the collection after the operation at step i. If the collection is empty, the maximum frequency is
Constraints:
nums.length
nums[i]
freq[i]
freq[i]
The input is generated such that the occurrences of an ID will not be negative in any step.
You are given two integer arrays nums and freq of length
At step i, freq[i] instances of the ID nums[i] are added to the collection if freq[i] is positive, or removed from the collection if freq[i] is negative.
Return an array ans of length ans[i] is the maximum frequency of any ID in the collection after the operation at step i. If the collection is empty, the maximum frequency is
Constraints:
nums.length
nums[i]
freq[i]
freq[i]
The input is generated such that the occurrences of an ID will not be negative in any step.