2216 | C++ | Easy O(N) solution
Code:\n\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) \n    {\n        int mini=0, i=0;\n        \n        //iterate till i is less than n-
**Code:**\n```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) \n    {\n        int mini=0, i=0;\n        \n        //iterate till i is less than n-1 index\n        while(i<nums.size()-1)\n        {\n            //(i%2+min)==0 to check whether we are at even index or odd\n            if((i%2+mini)==0 && nums[i] == nums[i+1])\n            {\n                mini++;\n                i++;\n            }\n            //when nums[i] != nums[i+1] we just jump to the next even index by incrementing i by 2.\n            else\n                i += 2;\n        }\n        \n        //if final nums size is odd we remove last element and increase mini by 1, to make it even.\n        return (nums.size()-mini) % 2 ? mini+1 : mini;\n \n    }\n};\n```
['C']