### Question:
L1 { public static int[] twoSum1(int[] nums, int target) { int[] indexs = new int[2]; HashMap<Integer,Integer> hash = new HashMap<>(6); for(int i = 0;i< nums.length;i++){ if(hash.containsKey(nums[i])){ indexs[0] = i; indexs[1] = hash.get(nums[i]); break; } hash.put(target - nums[i],i); } return indexs; }  static int[] twoSum1(int[] nums, int target);  }### Answer:
@Test void go() { int[] nums = {2, 7, 11, 15}; int targets = 9; int[] expected = {1, 0}; int[] actual = L1.twoSum1(nums, targets); assertArrayEquals(expected,actual); int[] nums2 = {3,2,4}; int targets2 = 6; L1.twoSum1(nums2, targets2); }