// 找出旋转点,二分
class Solution {
public boolean search(int[] nums, int target) {
int sep = -1;
int n = nums.length;
for (int i = 0;i < n - 1; i++){
if (nums[i] > nums[i + 1]){
sep = i;
break;
}
}
return searchNumber(nums, target, 0, sep + 1) ||
searchNumber(nums, target, sep + 1, n);
}
public boolean searchNumber(int[] nums, int target,int L, int R){
while (L < R){
int mid = (L + R) / 2;
if (target < nums[mid]){
R = mid;
}else if (target == nums[mid]){
return true;
}else {
L = mid + 1;
}
}
return false;
}
}