class Solution {
public:
    int minNumberInRotateArray(vector<int>& nums) {
        int start=0;
        int end=nums.size()-1;
        int mid=(start+end)/2;
        while(start<end)
        {
            //int mid=(start+end)/2;
            if(nums[mid]<nums[end])
                end=mid;
            else if(nums[mid]==nums[end])
            {
                end--;
            }
            else
                start=mid+1;
            mid=(start+end)/2;
        }
        return nums[mid];
    }
};