Python Solution [4 lines]
\n\nclass Solution:\n    def lastStoneWeight(self, stones: List[int]) -> int:\n        for i in range(len(stones) - 1):\n            stones.sort()\n            
```\n\nclass Solution:\n    def lastStoneWeight(self, stones: List[int]) -> int:\n        for i in range(len(stones) - 1):\n            stones.sort()\n            stones.append(stones.pop() - stones.pop()) \n        return stones[0]\n\t\t\n\t\t\n\t\tFollow me for more intresting programming questions :\n\t\t\t\t\t\t\thttps://www.github.com/shubhamthrills\n\t\t\t\t\t\t\thttps://www.instagaram.com/shubhamthrills\n\t\t\t\t\t\t\thttps://www.linkedin.com/in/shubhamsagar\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n#Another Possible approch [If you don\'t want to decrease the length of loop every time]\n\n```\n```\nclass Solution:\n    def lastStoneWeight(self, stones: List[int]) -> int:\n        #stones=[2,7,4,1,8,1]\n        for i in range(len(stones) - 1):\n            stones.sort()\n            temp=stones[-1] - stones[-2]\n            stones[-2]=-1\n            stones[-1]=temp\n        return (stones[-1])\n```
['Python']