38. Report First Regional Quota Crossings
EasyAPI quotas
Limits are [region, quota] pairs. Usage events are [region, units] in arrival order. Start each region at zero and ignore usage from regions with no limit.
Return [region, zero-based event index] for the first event that makes each region strictly exceed its quota, in order of occurrence.
Example 1
Input: limits = [["east",5],["west",2]], usage = [["east",5],["west",3],["east",1],["west",2]] Output: [["west",1],["east",2]]
Example 2
Input: limits = [["north",0]], usage = [["north",0],["south",20],["north",1],["north",1]] Output: [["north",2]]
Constraints
At most 100,000 limits and usage events each. Limit regions are unique.Quotas and units are integers in [0, 10⁶].