C++ | O(n) time, O(1) space | Easy to Understand
\n\nclass Solution {\npublic:\n    int minDeletion(vector<int>& num) {\n        int n = num.size(),ans=0;\n        for(int i = 0; i < n ; i+=2)  while(i+1<n and
\n```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& num) {\n        int n = num.size(),ans=0;\n        for(int i = 0; i < n ; i+=2)  while(i+1<n and num[i] == num[i+1]) i++,ans++;           \n        ans += (n-ans)&1;\n        return ans;\n    }\n};\n```
[]