|Java| Easy and Fast Solution
\n\n\nclass Solution {\n    public int lastStoneWeight(int[] stones) {\n        Arrays.sort(stones);\n        int count = stones.length-1;\n        while(count!
\n\n```\nclass Solution {\n    public int lastStoneWeight(int[] stones) {\n        Arrays.sort(stones);\n        int count = stones.length-1;\n        while(count!=0)\n        {\n            if(stones[stones.length-1]==stones[stones.length-2])\n            {\n                stones[stones.length-1]=0;\n                stones[stones.length-2]=0;\n            }\n            if(stones[stones.length-1]!=stones[stones.length-2])\n            {\n                stones[stones.length-1]=stones[stones.length-1] - stones[stones.length-2];\n                stones[stones.length-2]=0;\n            }\n            Arrays.sort(stones);\n            count--;\n        }\xA0 \xA0 \xA0 \xA0 \xA0 \xA0\n \xA0 \xA0return stones[stones.length-1]\n\t}\n}\n```
['Java']