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



京公网安备 11010502036488号