Problem 2336 · Medium
Hand out numbers in order from a counter, and let added-back numbers jump the queue through a min heap.
Open the interactive visualisation