You have an array of positive integers stones, each representing a stone's weight. Each round, pick the two heaviest stones. If they're equal, both shatter. Otherwise, the lighter one shatters and the heavier one becomes a new stone weighing the difference. Return the weight of the last remaining stone, or 0 if all shatter.
Constraints: 1 ≤ stones.length ≤ 30 · 1 ≤ stones[i] ≤ 1000.
Four stones: 5372. Each round, the two heaviest collide. The lighter one shatters. The heavier one chips — the chip that survives equals the DIFFERENCE. Last stone standing wins.
Before any smashing: will the final stone weigh zero, non-zero, or can you tell yet?