int findMin(vector<int> &num) {
int l = 0, r = num.size()-1;
while(l < r) {
int m = l + (r-l) /2;
if (num[m] < num[r])
r = m;
else
l = m +1;
}
return num[r];
}
No comments:
Post a Comment