33. Find Stale Events in a Replay
EasyEvent streams
Each incoming event is [key, version]. An event is stale if that key already had an event with an equal or higher version.
Return the zero-based indexes of stale events in arrival order. A stale event does not lower the latest version.
Example 1
Input: events = [["sync",3],["other",1],["sync",1],["sync",2],["sync",4]] Output: [2,3]
Example 2
Input: events = [["alerts",2],["alerts",2],["alerts",3]] Output: [1]
Constraints
0 ≤ events.length ≤ 100,000Versions are integers in [0, 10⁹]. Keys are nonempty strings.