Simple Python Solution with O(n) time complexity and O(1) space complexity
\nclass Solution(object):\n    def minDeletion(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        \n        if 
```\nclass Solution(object):\n    def minDeletion(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        \n        if len(nums) > 1:\n# The \'pointer\' points to the left hand side array element in comparision ie nums[i]\n# The \'high\' points to the right hand side array element in comparision ie nums[i+1]\n# The \'del_count\' will store the elements deleted in the process\n            pointer, high, del_count = 0, 1, 0\n            \n            while high < len(nums):\n                if nums[pointer] == nums[high]:\n# Delete the right hand side element\n                    del_count += 1\n# Make the next element in the array as right hand side of the comparision. This high will always point at the odd index post deletion. Since actual deletion is not required, just moving the pointer\n                    high += 1\n                \n        \n                else:\n# Increment the left hand side array element to next even index.\n                    pointer = high + 1\n# The high will point to the next element of the right hand of comparision.    \n                    high += 2\n                \n# Check if the upgraded array has even or odd length. If it is odd, then delete the last element.        \n            \n            \n            return del_count + ((len(nums) - del_count) % 2 == 1) \n        \n        elif len(nums) == 1: return 1\n        \n        else: return 0\n      \n```\nComplexity:\nTime - O(n)\nSpace - O(1)
['Python']