You are given an array of stone weights. Each turn, smash the two heaviest stones together: if they are equal both are destroyed, otherwise the heavier one is left with the difference. Return the weight of the last remaining stone, or 0 if none is left.
Practise this challenge
All coding challenges