An at-least-once source delivers duplicates and out-of-order events. Given a list of events {"key": str, "ts": ISO ts, "payload": any}, keep only the latest event per key (by ts). If two events for a key share the same ts, the one appearing later in the input wins (so replaying the batch is idempotent).
Return the surviving events sorted by key.
What the tests check
4 on Run · 5 on Submit01empty input
02keeps the latest ts per key
03equal ts: later in input wins (idempotent replay)
04multiple keys returned sorted by key
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.