Simple solution on Swift / Beats 100%
Please upvote if the solution was useful!\n\nfunc lastStoneWeight(_ stones: [Int]) -> Int {\n    var stones = stones.sorted(by: >)\n    while stones.count != 1 
### Please upvote if the solution was useful!\n```\nfunc lastStoneWeight(_ stones: [Int]) -> Int {\n    var stones = stones.sorted(by: >)\n    while stones.count != 1 {\n        let secondItem = stones.remove(at: 1)\n        stones[0] -= secondItem\n        stones = stones.sorted(by: >)\n    }\n    return stones[0]\n}\n```\n![Screenshot 2023-01-13 at 14.24.35.png](https://assets.leetcode.com/users/images/55e2fb05-ef3c-4b98-8106-8e68367dfb95_1673616334.6630821.png)\n
['Swift']