Beats 100%

@shiyi001 said in Beats 100%:
这题采用了二分查找，居然击败了100%，好鸡冻好鸡冻class Solution {
publicint findMin(vector<int>& nums) { int len = nums.size(); return find(nums, 0, len1); } int find(vector<int>& nums, int l, int r){ if (l+1 == r && nums[l] > nums[r]) return nums[r]; if (nums[l] <= nums[r]) return nums[l]; int mid = (l+r)>>1; if (nums[mid] > nums[l]) return find(nums, mid, r); else return find(nums, l, mid); }
};