The solution is supposed to be an O(n) algorithm.

However, system accepted it...

```
class Solution {
public:
int findMin(vector<int> &num) {
int l = 0, r = num.size()-1;
while (l < r) {
while (l < r && num[l] == num[r])
r--;
if (num[l] < num[r])
return num[l];
int mid = (l+r)>>1;
if (num[mid] >= num[l]) {
if (num[mid+1] < num[l])
return num[mid+1];
l = mid+1;
} else {
r = mid;
}
}
return num[r];
}
};
```