C++ || O(n) time O(1) space || commented solution
\'\'\'\n\n    int minDeletion(vector& nums) {\n        int n= nums.size();\n        int n1=n;\n        int i=0, j=0;\n        int cnt=0;\n\t\t\n        // j is 
\'\'\'\n\n    int minDeletion(vector<int>& nums) {\n        int n= nums.size();\n        int n1=n;\n        int i=0, j=0;\n        int cnt=0;\n\t\t\n        // j is virtual index after removing ith element\n        while(i<n-1 && j<n1){\n            if(j%2==0 && nums[i]==nums[i+1])\n            {\n                n1--; // new size after deleting elements\n                cnt++; //counting deleted elements\n            }\n            else\n            {\n                j++;\n            }\n            i++;\n        }\n        // if the array size after deleting is odd the removing last element to make it even\n        if(n1%2!=0){\n            return cnt+1;\n        }\n        \n        return cnt;\n    }\n\t
['Greedy', 'C']