[Python] Simple Intuitive solution
In the approach, we are actaully doing pop element which does the left shift\n\nclass Solution:\n    def minDeletion(self, nums: List[int]) -> int:\n        i =
In the approach, we are actaully doing pop element which does the left shift\n```\nclass Solution:\n    def minDeletion(self, nums: List[int]) -> int:\n        i = 0\n        count = 0\n        while i + 1 < len(nums):\n            if i % 2 == 0 and nums[i] == nums[i+1]:\n                count += 1\n\t\t\t\t # left shift\n                nums.pop(i)\n                continue\n            i += 1\n        return count if len(nums) % 2 == 0 else count + 1\n        \n```\n\nHere, we are avoiding the pop and using the duplicate count value to check for the index (if nums would have be popped count times)\nThis improves the time complexity\n\n```\nclass Solution:\n    def minDeletion(self, nums: List[int]) -> int:\n        i = 0\n        count = 0\n        while i + 1 < len(nums):\n            if (i - count) % 2 == 0 and nums[i] == nums[i+1]:\n                count += 1\n            i += 1\n        return count + (len(nums) - count) % 2\n```
['Stack', 'Python']