标签:array solution nim int imu etc ted mini vector
class Solution {
public:
int fk(int l,int r,vector<int>& nums){
if(nums[l]<=nums[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
标签:array solution nim int imu etc ted mini vector
原文地址:http://www.cnblogs.com/clover-xuqi/p/7154878.html