class Solution {
public:
    vector<int> a;
    int findMin(int l,int r)
    {
        while(l<r)
        {
            int mid=(l+r)/2;
            if(a[mid]<a[r]) r=mid;
            else if(a[mid]>a[r])l=mid+1;
            else r--;
        }
        return a[l];
    }
    int minNumberInRotateArray(vector<int> rotateArray) {
        this->a=rotateArray;
        return findMin(0,rotateArray.size()-1);
    }
};