✅ [C++] | EASY SOLUTION | TC : O(N) | SC : O(1)
\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        \n        int ans=0;\n        int sz=nums.size();\n        \n        for(int i=0;
```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        \n        int ans=0;\n        int sz=nums.size();\n        \n        for(int i=0;i<sz-1;i++){\n            //if effective index is even and it has same number at its index + 1  then we have to remove it  \n            if((i-ans)%2==0 and nums[i+1]==nums[i]){\n                    ans++;\n            }\n            \n        }\n\t\t//if after deleting optimizely new size is odd then we have to remove one more element to make size even\n        if((sz-ans)%2) ans++;\n        return ans;\n        \n    }\n};\n```
['C++']