@@ -0,0 +1,1138 @@
+package leetcode;%0A%0A/**%0A * https://leetcode.com/problems/search-in-rotated-sorted-array/%0A */%0Apublic class Problem33 %7B%0A    public int search(int%5B%5D nums, int target) %7B%0A        int prev = 0;%0A        int current;%0A        for (current = 1; current %3C nums.length; current++) %7B%0A            if (nums%5Bcurrent%5D %3C nums%5Bprev%5D) %7B%0A                break;%0A            %7D%0A            prev = current;%0A        %7D%0A        int startIdx = current;%0A        if (current == nums.length) %7B%0A            startIdx = 0;%0A        %7D%0A        return binarySearch(nums, target, 0, nums.length-1, startIdx);%0A    %7D%0A%0A    private int binarySearch(int%5B%5D nums, int target, int lo, int hi, int startIdx) %7B%0A        if (lo %3E hi) %7B%0A            return -1;%0A        %7D%0A        int mid = (lo + hi) / 2;%0A        int midIdx = startIdx + mid;%0A        if (midIdx %3E= nums.length) %7B%0A            midIdx = midIdx - nums.length;%0A        %7D%0A        if (nums%5BmidIdx%5D == target) %7B%0A            return midIdx;%0A        %7D%0A        if (nums%5BmidIdx%5D %3E target) %7B%0A            return binarySearch(nums, target, lo, mid-1, startIdx);%0A        %7D%0A        return binarySearch(nums, target, mid+1, hi, startIdx);%0A    %7D%0A%7D%0A

Solve problem 33