[Python 3] O(N) time O(1) space
Variable index is to keep track of the current index of nums after "deletion"\nDuring for loop if index%2==0 and nums[i] == nums[i+1] we just don\'t increment i
Variable *index* is to keep track of the current index of *nums* after "deletion"\nDuring for loop if index%2==0 and nums[i] == nums[i+1] we just don\'t increment index.\n\n```\nclass Solution:\n    def minDeletion(self, nums: List[int]) -> int:\n        res=0\n        index=0\n        for i in range(len(nums)-1):\n            if index%2==0 and nums[i] == nums[i+1]:\n                res+=1\n            else:\n                index+=1\n        return res if index%2 else res+1\n```
[]