Easy Python Solution
Code\n\nclass Solution:\n    def lastStoneWeight(self, stones: List[int]) -> int:\n        stones.sort()\n        while len(stones)>1:\n            y=stones.pop
# Code\n```\nclass Solution:\n    def lastStoneWeight(self, stones: List[int]) -> int:\n        stones.sort()\n        while len(stones)>1:\n            y=stones.pop(-1)\n            x=stones.pop(-1)\n            if x!=y:\n                stones.append(y-x)\n            stones.sort()\n        return stones[0] if len(stones)>=1 else 0\n```
['Python3']