Python binary search O(logn)
\nclass Solution(object):\n    def singleNonDuplicate(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        if len
```\nclass Solution(object):\n    def singleNonDuplicate(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        if len(nums) < 1:\n            return None\n        l, r = 0, len(nums)-1\n        while l < r:\n            m = l + (r - l)/2\n            if m - 1 < l or m + 1 > r:\n                break\n            if m % 2 == 0:\n                if nums[m] == nums[m+1]:\n                    l = m + 2\n                else:\n                    r = m\n            else:\n                if nums[m] == nums[m-1]:\n                    l = m + 1\n                else:\n                    r = m\n        return nums[l]\n```
[]