Process requests per user, allowing at most K within any window of T time units.
Unlock detailed company stats for this questionUpgrade
Implement List<Integer> rateLimiter(List<Integer> user, List<Integer> time, int K, int T). Given parallel lists of user ids and request times, return 1 for each request that is allowed and 0 if denied. A request is allowed if fewer than K of that user's allowed requests occurred within the last T time units. Keep a per-user deque of recent request times.
Format · Online assessment.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
