Python Solution


  • 0
    L

    There are only 3 scenarios for this problem. Code as below:

        def findMin(self, nums):
            """
            :type nums: List[int]
            :rtype: int
            """
            left = 0
            right = len(nums) - 1
            while left + 1 < right:
                mid = (left + right) /2
                if (nums[mid] > nums[0]) and nums[mid] > nums[-1]:
                    left = mid
                else:
                    right = mid
            return min(nums[left], nums[right])
    
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.