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