class Solution {
public:
int minNumberInRotateArray(vector<int> rotateArray) {
int len = rotateArray.size();
if(len == 0)
{
return 0;
}
sort(rotateArray.begin(), rotateArray.end());
return rotateArray.front();
}
};
剑指Offer_编程题 | 旋转数组的最小数字
最新推荐文章于 2022-03-19 13:48:27 发布