牛客网-《剑指offer》-旋转数组的最小数

时间:2022-05-14 21:05:11

题目:http://www.nowcoder.com/practice/9f3231a991af4f55b95579b44b7a01ba

C++

 class Solution {
public:
int minNumberInRotateArray(vector<int> arr) {
int len = arr.size();
if (len == ) return ;
int ret = arr[];
for (int i = ; i < len; i++) {
if (arr[i] < ret) return arr[i];
}
return ret;
}
};