Easy JS Solution
\n/**\n * @param {number[]} stones\n * @return {number}\n */\nvar lastStoneWeight = function(stones) {\n    while (stones.length > 1) {\n        let max1 = Math
```\n/**\n * @param {number[]} stones\n * @return {number}\n */\nvar lastStoneWeight = function(stones) {\n    while (stones.length > 1) {\n        let max1 = Math.max(...stones);\n        stones.splice(stones.indexOf(max1),1);\n        let max2 = Math.max(...stones);\n        stones.splice(stones.indexOf(max2),1);\n        if (max1 !== max2) stones.push(Math.abs(max1-max2));       \n    }\n    return stones[0] || 0;\n};\n```
['JavaScript']