# -*- coding:utf-8 -*-
class Solution:
    def minNumberInRotateArray(self, rotateArray):
        # write code here
        if not rotateArray:return None
        left,right=0,len(rotateArray)-1
        while left<right:
            mid=(left+right)//2
            if rotateArray[mid]>rotateArray[right]:
                left=mid+1
            elif rotateArray[mid]<rotateArray[right]:right=mid
            else: right-=1
        return rotateArray[left]