```
public static int[] twoSum(int[] numbers, int target) {
Arrays.sort(numbers);
int size = numbers.length;
int[] answers = {0,0};
for(int i=0;i<size;i++)
{
if(Arrays.binarySearch(numbers, target-numbers[i])>0)
{
answers[0] = numbers[i]<target-numbers[i]?numbers[i]:target-numbers[i];
answers[1] = numbers[i]>target-numbers[i]?numbers[i]:target-numbers[i];
break;
}
}
return answers;
}
```