public int[] twoSum(int[] numbers, int target) {
int x=0;
int y=0;
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for(int i=0;i<numbers.length;i++) {
if(map.containsKey(target-numbers[i])) {
x = i;
y = map.get(target-numbers[i]);
break;
} else {
map.put(numbers[i], i);
}
}
if(x<y) {
return new int[]{x+1,y+1};
} else {
return new int[]{y+1,x+1};
}
}