Fixed window rate limiter

Write codeMedium25 minStripe style

Your task

Implement a fixed-window rate limiter per client. Time is divided into fixed windows of window seconds aligned to zero: the window for timestamp t is floor(t / window). Each client may make at most limit requests per window; requests beyond the limit in the same window for the same client are rejected. Given a list of [timestamp, client_id] requests in non-decreasing timestamp order, return a list of booleans (allowed/rejected) per request.

Examples

fixed_window_limiter(requests: list[list], window: int, limit: int) -> list[bool]
Example 1
Inputfixed_window_limiter([[0, "a"], [1, "a"], [2, "a"], [10, "a"]], 10, 2)
Output[True, True, False, True]