#!/usr/bin/env python3

__author__ = 'Wei Mu'

class Solution:
    def findMin(self, nums: List[int]) -> int:
        # print(nums)
        if len(nums) == 1:
            return nums[0]
        if len(nums) == 2:
            if nums[0] > nums[1]:
                return nums[1]
            return nums[0]
        
        mid = (len(nums) - 1)//2
        
        if nums[mid] > nums[-1]:
            return self.findMin(nums[mid:])
        else:
            return self.findMin(nums[:mid+1])
        
