public int[] twoSum(int[] numbers, int target)
{
int i = 0, j = numbers.length-1;
int[] ret = new int[2];
while (i < j)
{
while (target > 0 && numbers[j] > target)
j--;
if (numbers[i] + numbers[j] > target)
{
j--;
}
else if (numbers[i] + numbers[j] == target)
{
ret[0] = i+1;
ret[1] = j+1;
return ret;
}
else
{
i++;
}
}
return null;
}