C++ || Simple & Easy Code || 3 lines || Explained
\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        int cnt=0;\n        for(int i=0;i<nums.size()-1;i++){\n            if(nums[i] == 
```\nclass Solution {\npublic:\n    int minDeletion(vector<int>& nums) {\n        int cnt=0;\n        for(int i=0;i<nums.size()-1;i++){\n            if(nums[i] == nums[i+1] && (i-cnt)%2 == 0){cnt++;} \n            //just check for nums[i] != nums[i + 1] for all i % 2 == 0\n            // (i - cnt) is the index of element after deletion of the elements \n        }\n        return cnt + (nums.size()-cnt)%2; \n        // now cnt is the count of elements removed from nums, so (nums.size()-cnt) gives the size of final array after deletion.\n        // (nums.size()-cnt) % 2 will check is the final array size is even or not, if its even it will add 1 to the final as \n        // otherwise it will add 0 \n    }\n};\n```\nDo upvote if it helped :)\n
['Greedy', 'C', 'C++']