Python beats 100%
Use binary search. It mid is even, then check nums[mid] and nums[mid + 1]. If they are equal, then the target must be on the right half. Similarly for mid is od
Use binary search. It mid is even, then check nums[mid] and nums[mid + 1]. If they are equal, then the target must be on the right half. Similarly for mid is odd, check nums[mid] and nums[mid - 1].\n```\nclass Solution(object):\n    def singleNonDuplicate(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        left, right = 0, len(nums) - 1\n        while left + 1 < right:\n            mid = (left + right) // 2\n            if mid % 2 == 1:\n                if nums[mid] == nums[mid - 1]:\n                    left = mid\n                else:\n                    right = mid\n            else:\n                if nums[mid] == nums[mid + 1]:\n                    left = mid\n                else:\n                    right = mid\n        #print(left, right)\n        if left % 2 == 0:\n            return nums[left]\n        return nums[right]\n```\nPlease upvote if you find it helpful\uFF01
['Binary Tree', 'Python', 'Python3']