✅ C++ | Easy
\nclass Solution\n{\n    public:\n        int minDeletion(vector<int> &nums)\n        {\n            int shift = 0;\n            for (int i = 0; i < nums.size()
```\nclass Solution\n{\n    public:\n        int minDeletion(vector<int> &nums)\n        {\n            int shift = 0;\n            for (int i = 0; i < nums.size() - 1; i++)\n            {\n                if ((i + shift) % 2 == 0)\n                {\n                    if (nums[i] == nums[i + 1])\n                    {\n                        shift++;\n                    }\n                }\n            }\n            if ((nums.size() - shift) % 2 == 1)\n            {\n                shift++;\n            }\n            return shift;\n        }\n};\n```
[]