Last Stone Weight
Heap · Repeatedly take the most important item · Easy · about 18 min
Why it matters
Heaps are for a changing “best next item” without sorting everything again.
How it connects
A queue processes the oldest item first. A heap processes the largest priority first.
Try first
What would be expensive if you sorted all stones again after every smash?
Interview cue
A heap makes each remove/add O(log n), avoiding repeated full sorts.