117. Apply a Sliding Request Limit
MediumAPI quotas
Requests are [account, timestamp] pairs in nondecreasing timestamp order. Each account can have at most limit accepted requests in any window of width time units.
For a request at t, count earlier accepted requests from its account at times in (t - width, t]. Accept only if that count is below limit. Equal timestamps follow input order and rejected requests never count. Return an array of Booleans.
Example 1
Input: requests = [["a",0],["a",4],["a",5],["a",5],["a",9],["a",10]], width = 5, limit = 1 Output: [true,false,true,false,false,true]
Example 2
Input: requests = [["a",1],["b",1],["b",1],["a",2]], width = 10, limit = 1 Output: [true,true,false,false]
Constraints
At most 100,000 requests. Times are integers in [0, 10⁹].1 ≤ width ≤ 10⁹ and 0 ≤ limit ≤ 100,000.