```
class Solution {
public:
int findMin(vector<int> &num) {
int b=0, e=num.size();
int result = INT_MAX;
while(b!=e) {
auto mid = (b+e)>>1;
if(num[mid]>num[b]) {
result = min(num[b],result);
b = mid+1;
}
else if(num[mid]<num[b]) {
result = min(num[mid],result);
e = mid;
}
else result = min(num[b++],result);
}
return result;
}
};
```