Anti-replay nonce window
Your task
Implement anti-replay over a stream of signed requests. Each request is [nonce, timestamp]. Process them in order against a window of 'ttl' seconds and a tracking clock equal to the max timestamp seen so far. A request is ACCEPTED iff: its timestamp is within ttl of the current max (i.e. timestamp >= current_max - ttl) AND its nonce has not been accepted before within the live window. On accept, record the nonce and advance the max; also evict any remembered nonces whose timestamp is older than (new_max - ttl). Reject (do not record) otherwise. Return the list of booleans, one per request, indicating acceptance.
Examples
anti_replay(requests: list[list], ttl: int) -> list[bool]Example 1
Input
anti_replay([["n1", 100], ["n2", 101], ["n1", 102]], 60)Output
[True, True, False]