🔥🔥 BINGO [ C++ ] Easy Clean Code :)
\nclass Solution\n{\n    public:\n        vector<int> applyOperations(vector<int> &nums)\n        {\n            int n = nums.size() - 1;\n            for (int 
```\nclass Solution\n{\n    public:\n        vector<int> applyOperations(vector<int> &nums)\n        {\n            int n = nums.size() - 1;\n            for (int i = 0; i < n;)\n            {\n                if (nums[i] == nums[i + 1])\n                {\n                    nums[i] = nums[i] *2;\n                    nums[i + 1] = 0;\n                    i = i + 1;\n                }\n                i++;\n            }\n            int i = 0;\n            for (int j = 0; j < nums.size(); j++)\n            {\n                if (nums[j] != 0)\n                {\n                    swap(nums[j], nums[i]);\n                    i++;\n                }\n            }\n            return nums;\n        }\n};\n\n// TC -> O(N)\n// SC -> O(1)\n\n```
['C', 'C++']