Very Short C++ Code
\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {      \n        int n=nums.size();\n        int cnt=0;\n\t\t//ind is our virtual index afte
```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {      \n        int n=nums.size();\n        int cnt=0;\n\t\t//ind is our virtual index after deletion\n        for(int i=0;i<n-1;i++){\n            //ind--> we are shifting element to left to keep what will be the index of element after deleting element.\n            //cnt--> tells how many elements we have deleted.\n            int ind=i-cnt;\n          if((ind)%2==0 and nums[i]==nums[i+1]){             \n              cnt++;\n          }  \n        }\n\t\t//Edge Case Condition.\n       if((n-cnt)%2) cnt++;\n\t   \n    return cnt;\n    }\n};\n```
[]