class Solution {
public:
    int minNumberInRotateArray(vector<int> rotateArray) {
        int left = 0, right = rotateArray.size()-1;
        while(left < right)
        {
            int mid = (left+right) / 2;//取中间值
            if(rotateArray[mid] > rotateArray[right])  left = mid+1;//搜索右边
            else if(rotateArray[mid] < rotateArray[right])  right = mid;//搜索左边
            else right -= 1;
        }
        return rotateArray[left];
    }
};

/*12345
        23451
        34512
        45123
        51234*/