```
class Solution {
public:
int findMin(vector<int>& nums) {
int size = nums.size();
int l = 0;
int r = size-1;
while(r-l>1)
{
int m = l+(r-l)/2;
if(nums[m] > nums[r])
{
l = m;
}
else
{
r = m;
}
}
return (nums[r]<nums[l]?nums[r]:nums[l]);
}
};
```