Minimum Deletions to Make Array Beautiful O(N) single pass C++
\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        bool even=true;\n        int count=0;\n        for(int i=1;i<nums.size();i++){\n 
```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        bool even=true;\n        int count=0;\n        for(int i=1;i<nums.size();i++){\n            if(even==true && i%2==1){\n            if(nums[i]==nums[i-1]){\n                count++;\n                even=false;\n            }\n            }\n            else if(even==false && i%2==0){\n                if(nums[i]==nums[i-1]){\n                    count++;\n                    even=true;\n                }\n            }\n        }\n        if(nums.size()==0) return count;\n        if((nums.size()-count)%2==1) count++;\n        return count;\n    }\n};\n```
[]