You are given an integer array stones, where stones[i] represents the weight of the
A game is played as follows: on each turn, any two stones are selected and smashed together. Given two stones with weights x and y where x <= y, the outcome is:
If x == y, both stones are destroyed.
If x != y, the stone of weight x is destroyed, and the stone of weight y is replaced with a new stone of weight y - x.
The game ends when at most one stone remains.
Return the smallest possible weight of the remaining stone. If no stones remain, return
Constraints:
stones.length
stones[i]
You are given an integer array stones, where stones[i] represents the weight of the
A game is played as follows: on each turn, any two stones are selected and smashed together. Given two stones with weights x and y where x <= y, the outcome is:
If x == y, both stones are destroyed.
If x != y, the stone of weight x is destroyed, and the stone of weight y is replaced with a new stone of weight y - x.
The game ends when at most one stone remains.
Return the smallest possible weight of the remaining stone. If no stones remain, return
Constraints:
stones.length
stones[i]