import java.util.*; public class Solution { public int[] twoSum (int[] numbers, int target) { int[] result = new int[2]; Map<Integer, Integer> map = new HashMap(); for(int i = 0; i < numbers.length; i++) { if(map.get(target - numbers[i]) != null) { result[0] = map.get(target - numbers[i]) + 1; result[1] = i + 1; return result; } map.put(numbers[i], i); } return result; } }