@@ -0,0 +1,874 @@
+package medium;%0A%0Aimport utils.CommonUtils;%0A%0Apublic class TwoSumIIInputArrayIsSorted %7B%0A    public static int%5B%5D twoSum(int%5B%5D numbers, int target) %7B%0A        int left = 0, right = numbers.length-1;%0A        int%5B%5D result = new int%5B2%5D;%0A        while(numbers%5Bright%5D %3E target) right--;%0A        if(right %3C numbers.length-1) right++;%0A        while(left %3C= right)%7B%0A            int sum = numbers%5Bleft%5D + numbers%5Bright%5D;%0A            if(sum %3E target) right--;%0A            else if(sum %3C target) left++;%0A            else if(sum == target)%7B%0A                result%5B0%5D = left+1;%0A                result%5B1%5D = right+1;%0A                break;%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A    %0A    public static void main(String...strings)%7B%0A        int%5B%5D nums = new int%5B%5D%7B-3,3,4,90%7D;%0A        int k = 0;%0A        int%5B%5D result = twoSum(nums, k);%0A        CommonUtils.printArray(result);%0A    %7D%0A%7D%0A

two sum II input array is sorted