Throttler (Rate Limiter)

Design a Throttler (rate limiter) that allows at most N requests in any sliding time window of length W.

For each request with timestamp t (non-decreasing), decide whether it is allowed: if f...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: