```
public static int[] twoSum(int[] numbers, int target){
if(numbers==null||numbers.length==0)
return new int[0];
int[] result=new int[2];
int len=numbers.length,low=0,high=len-1;
while(low<high){
if(numbers[low]+numbers[high]==target){
result[0]=low+1;
result[1]=high+1;
return result;
}
else if(numbers[low]+numbers[high]>target)
high--;
else
low++;
}
return new int[0];
}
```