it is very obviously that if all the elements in the array are not equal, the min one should smaller than the one before it. so below is my answer.

```
class Solution {
public:
int findMin(vector<int> &num) {
if(num.size() == 1 || num[0] < num[num.size()-1] ) return num[0];
for(int i = 1; i < num.size(); i++) {
if(num[i] < num[i-1]) return num[i];
return num[0];
}
};
```