```
class Solution {
public:
int findMin(vector<int> &num) {
int head = 0;
int tail = num.size() - 1;
while(head < tail)
{
if(num[head] == num[tail])
{
--tail;
continue;
}
if(num[head] < num[tail])
break;
int body = (head + tail) / 2;
if(num[head] <= num[body])
head = body + 1;
else
tail = body;
}
return num[head];
}
};
```