Question
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.
anti_replay(requests: list[list], ttl: int) → list[bool][[["n1",100],["n2",101],["n1",102]],60]out[true,true,false]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.