Loading homepage
Evaluate a batch of request timestamps with a sliding-window limit, counting only previously accepted requests.
Input: rateLimit([0, 1, 2, 10, 11], 2, 10) Output: [true, true, false, true, true]
Input: rateLimit([5, 5, 5], 1, 10) Output: [true, false, false]
Implement the exported function in index.js or index.ts. Tests provide fixtures for the required behavior.