int findMin(vector<int> &num) {

int start = 0, end = num.size()-1;

while(start<end){

while(start<end && num[start]==num[end])

start++;

if(num[start]<num[end])

return num[start];

int mid = start + ((end-start)>>1);

if (num[mid]<=num[end])

end = mid;

else

start = mid+1;

}

return num[start];

}