@@ -0,0 +1,918 @@
+# Time:  O(logn)%0A# Space: O(1)%0A%0A# Given a sorted array consisting of only integers%0A# where every element appears twice except for one element%0A# which appears once. Find this single element that appears only once.%0A#%0A# Example 1:%0A# Input: %5B1,1,2,3,3,4,4,8,8%5D%0A# Output: 2%0A# Example 2:%0A# Input: %5B3,3,7,7,10,11,11%5D%0A# Output: 10%0A# Note: Your solution should run in O(log n) time and O(1) space.%0A    %0Aclass Solution(object):%0A    def singleNonDuplicate(self, nums):%0A        %22%22%22%0A        :type nums: List%5Bint%5D%0A        :rtype: int%0A        %22%22%22%0A        left, right = 0, len(nums)-1%0A        while left %3C= right:%0A            mid = left + (right - left) / 2%0A            if not (mid%252 == 0 and mid+1 %3C len(nums) and %5C%0A                    nums%5Bmid%5D == nums%5Bmid+1%5D) and %5C%0A               not (mid%252 == 1 and nums%5Bmid%5D == nums%5Bmid-1%5D):%0A                right = mid-1%0A            else:%0A                left = mid+1%0A        return nums%5Bleft%5D%0A

Create single-element-in-a-sorted-array.py