标签:leetcode == tco nim ota public ret turn solution
class Solution {
public:
int fk(int l,int r,vector<int>& nums){
if(nums[l]<nums[r]||l==r)return nums[l];
int m = (l+r)/2;
int k1 = fk(l,m,nums);
int k2 = fk(m+1,r,nums);
return min(k1,k2);
}
int findMin(vector<int>& nums) {
int n = nums.size();
return fk(0,n-1,nums);
}
};
LeetCode - Find Minimum in Rotated Sorted Array II
标签:leetcode == tco nim ota public ret turn solution
原文地址:http://www.cnblogs.com/clover-xuqi/p/7154874.html