Good to go💯🚀. Must read Easy Template
26. Remove Duplicates from Sorted Array\n27. Remove Element\n80. Remove Duplicates from Sorted Array II\n283. Move Zeroes\n2460. Apply Operations to an Array\n9
[26. Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/solutions/5505499/my-accepted-java-solution/)\n[27. Remove Element](https://leetcode.com/problems/remove-element/solutions/5505493/good-to-go/)\n[80. Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/solutions/5505483/my-accepted-java-solution-with-similar-problems/)\n[283. Move Zeroes](https://leetcode.com/problems/move-zeroes/solutions/5810033/good-to-go-okay-so-here-is-the-template/)\n[2460. Apply Operations to an Array](https://leetcode.com/problems/apply-operations-to-an-array/solutions/5810074/good-to-go-must-read-easy-template/)\n[905. Sort Array By Parity](https://leetcode.com/problems/sort-array-by-parity/solutions/5810076/fastest-solution-out-there-bits-on-fire/)\n[2418. Sort the People](https://leetcode.com/problems/sort-the-people/solutions/5810092/goo-to-go-all-possible-solution/)\n\n\n# Code\n```java []\n// Approach -1\n\nclass Solution {\n    public int[] applyOperations(int[] nums) {\n        int n = nums.length;\n        \n        // Apply operations\n        for (int i = 0; i < n - 1; i++) {\n            if (nums[i] == nums[i + 1]) {\n                nums[i]= nums[i]<<1;\n                nums[i + 1] = 0;\n            }\n        }\n        \n        // Move non-zero elements to the front\n        int nonZeroIndex = 0;\n        for (int i = 0; i < n; i++) {\n            if (nums[i] != 0) {\n                nums[nonZeroIndex++] = nums[i];\n            }\n        }\n        \n        // Fill the rest with zeros\n        while (nonZeroIndex < n) {\n            nums[nonZeroIndex++] = 0;\n        }\n        \n        return nums;\n    }\n}\n```\n```java []\n// Appraoch - 2\n\nclass Solution {\n    public int[] applyOperations(int[] nums) {\n        int n = nums.length;\n        \n        // Apply operations\n        for (int i = 0; i < n - 1; i++) {\n            if (nums[i] == nums[i + 1]) {\n                nums[i] = nums[i]<<1;\n                nums[i + 1] = 0;\n            }\n        }\n        \n        // Move zeros to the end using two pointers\n        int nonZeroPtr = 0;\n        for (int i = 0; i < n; i++) {\n            if (nums[i] != 0) {\n                swap(nums, i, nonZeroPtr);\n                nonZeroPtr++;\n            }\n        }\n        \n        return nums;\n    }\n    \n    private void swap(int[] nums, int i, int j) {\n        if (i != j && nums[i] != nums[j]) {\n            nums[i] = nums[i] ^ nums[j];\n            nums[j] = nums[i] ^ nums[j];\n            nums[i] = nums[i] ^ nums[j];\n        }\n    }\n}\n```
['Java']