Skip to content
RED SAG Skills
medium10 pts · first answer countsstacks-and-queues

Last stone weight with a max-heap

Each turn, smash the two heaviest stones: equal ones both vanish, otherwise the difference is put back. Starting from [2, 7, 4, 1, 8, 1], what weight is left at the end?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions