class Solution { public boolean search(int[] nums, int target) { if(nums.length==0||nums==null){ return false; } int start=0; int end=nums.length-1; while(start<=end){ int mid=start+(end-start)/2; if(target==nums[mid]){ return true; } if(nums[start]==nums[mid]){ start++; continue; } if(nums[start]<nums[mid]){ if(target>=nums[start]&&target<nums[mid]){ end=mid-1; }else{ start=mid+1; } }else{ if(target>nums[mid]&&target<=nums[end]){ start=mid+1; }else{ end=mid-1; } } } return false; } }