@@ -0,0 +1,1715 @@
+public class Solution %7B%0A    public boolean search(int%5B%5D nums, int target) %7B%0A        if(nums == null )%7B%0A            return false;%0A        %7D%0A        boolean rotated  = isRotated(nums);%0A        if(rotated)%7B%0A            return binarySearchInRotated(nums, target);%0A        %7Delse%7B%0A            return binarySearch(nums, target,0,nums.length-1);%0A        %7D%0A    %7D%0A    %0A    private boolean isRotated(int%5B%5Dnums)%7B%0A        if(nums.length%3E1)%7B%0A            return nums%5B0%5D%3E=nums%5Bnums.length-1%5D;%0A        %7Delse%7B%0A            return false;%0A        %7D%0A    %7D%0A    %0A    private boolean binarySearch(int%5B%5D nums, int target,int i, int j)%7B%0A        int left = i;%0A        int right = j;%0A        while(left%3C=right)%7B%0A            int mid = left + (right-left)/2;%0A            if(target%3Enums%5Bmid%5D)%7B%0A                while(mid%3Cright && nums%5Bmid%5D==nums%5Bmid+1%5D)%7B%0A                    mid++;%0A                %7D%0A                left = mid+1;%0A            %7Delse if(target%3Cnums%5Bmid%5D)%7B%0A                while(mid%3Eleft && nums%5Bmid%5D == nums%5Bmid-1%5D)%7B%0A                    mid--;%0A                %7D%0A                right = mid - 1;%0A            %7Delse%7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A    %0A    private boolean binarySearchInRotated(int%5B%5Dnums,int target)%7B%0A        int left1 = 0;%0A        int right2 = nums.length-1;%0A        int right1 =0;%0A        int left2 = 0;%0A        for(int i=0;i%3Cnums.length-1;i++)%7B%0A            if(nums%5Bi%5D%3Enums%5Bi+1%5D)%7B%0A                right1 = i;%0A                left2 = i+1;%0A                break;%0A            %7D%0A        %7D%0A        if(target%3Enums%5Bright2%5D)%7B%0A            return binarySearch(nums,target,left1,right1);%0A        %7Delse%7B%0A            return binarySearch(nums,target,left2,right2);%0A        %7D%0A    %7D%0A%7D

The solution for 81