C++ | 5-6 lines code | O(n) time, O(1) space
Time Complexity: O(n)\nSpace Complexity: O(1)\n``` \nint minDeletion(vector& nums) {\n        int i=0, n=nums.size(), count=0;\n        while(i<n){\n           
Time Complexity: O(n)\nSpace Complexity: O(1)\n``` \nint minDeletion(vector<int>& nums) {\n        int i=0, n=nums.size(), count=0;\n        while(i<n){\n            while(i<n-1 && nums[i]==nums[i+1])i++, count++; \n             i+=2;    \n        }\n\t\t//if length of remaining sequence\xA0 is odd remove last element \n        if((n-count)&1)count++;\n\t\t\n        return count;\n        \n    }\n\t
['Greedy', 'C']