Easy to Understand||C++
class Solution {\npublic:\n\n    int minDeletion(vector& nums) {\n        int ans=0;\n        for(int i=1;i<nums.size();i++){\n            if(((i-1)-ans)%2==0 &
class Solution {\npublic:\n\n    int minDeletion(vector<int>& nums) {\n        int ans=0;\n        for(int i=1;i<nums.size();i++){\n            if(((i-1)-ans)%2==0 && nums[i]==nums[i-1] ){\n                ans++;\n            }\n            //12233\n        }\n        //12233 but size is odd so we have to remove one but from end not from middle because if we remove from middle it will affect the index of other element.\n        if((nums.size()-ans)%2){\n            ans++;\n        }\n        return ans;\n    }\n};``
['C', 'C++']