Real debounce is timing-based and hard to test deterministically. Instead,
implement solve(events, wait) that simulates trailing-edge debounce
over a fixed timeline.
events is a list of [timestampMs, value] pairs representing calls to a
debounced function. Return a list of [emitTimeMs, value] pairs that the
debounced function would actually fire.
Semantics (trailing edge)
wait ms after the last call inside a quiet window.emission stays in the result.
Examplesolve([[0,'a'], [50,'b'], [200,'c']], 100) → [[150,'b'], [300,'c']]
Sample tests