A bid with 10 seconds left makes the auction longer
transcript
Ten seconds left on a film poster. Ravi bids. And the auction gets longer. That's how you beat snipers.
The poster ends at 3,600. At 3,590, Ravi bids 5,000. The end moves to 3,710. At 3,700, Asha bids 5,200. Now 3,820. A bid in the last two minutes? The end moves to two minutes after it.
But two bots could extend it forever. So extensions are capped. Ten, here.
Now a catch. The timer's heap holds an entry for 3,600. It's wrong. Find it and remove it? That's a search. Order n. Instead, just push a new entry for 3,710. The old one pops at 3,600. The auction sees 3,710. Nothing happens.
At 3,820 the poster closes. 5,200 beats the 5,000 reserve. Asha hears she won. Ravi's 6,000, a second later? Told the auction is sold.
A late bid moves the end, with a cap. And stale heap entries are skipped when they pop. Never searched for.
Full breakdown in the lecture.