How do you solve the last stone weight problem, and what does the problem really ask?
The process is a simulation. Take the two heaviest stones, smash them together, and if they are different the difference becomes a new stone that goes back into the collection. If they are equal, both disappear. Continue until at most one stone is left, and its weight is the answer. If no stones remain, the answer is zero.
What the problem is really asking is what the smallest possible remaining weight is. The greedy choice to always smash the two heaviest is optimal, and the intuition is that the heaviest stones are the ones most likely to cancel each other out, leaving smaller residues behind.
The mechanism is that each round you need the two largest elements. Doing that by scanning the whole collection every time is quadratic, so the natural implementation keeps the stones in a max heap and takes the two roots.
The trade-off to name is that the greedy argument is not a full proof, and a careful interviewer may push on it. The standard justification is an exchange argument: if an optimal sequence smashed a lighter pair before a heavier one, you can swap those two rounds without making the outcome worse, because the heavier difference dominates the lighter one. That is the sort of reasoning an interviewer wants to hear. The other point is the complexity, which is quadratic if you scan the list each round and linear in the number of rounds times the logarithm of the number of stones if you use a heap.