Tag
Replay timestamped credit events with an expiry-ordered heap, then cache balances across a bounded time horizon. Includes tested Java and Python solutions.