C++ || O(n) time O(1) space || Clean and Concise code
\n    int minDeletion(vector<int>& nums) {\n        int n=nums.size(),ans=0,i=0;\n        while(i<n)\n        {\n            if(i<n-1 && nums[i]==nums[i+1]) ans
```\n    int minDeletion(vector<int>& nums) {\n        int n=nums.size(),ans=0,i=0;\n        while(i<n)\n        {\n            if(i<n-1 && nums[i]==nums[i+1]) ans++, i--;\n            i+=2;\n        }\n        if((n-ans)%2) ans++;\n        return ans;\n    }\n```
[]