public int[] twoSum(int[] nums, int target) {
if (nums.length == 0) return null;
Map<Integer, Integer> map = new HashMap<>();
for(int i = 0; i < nums.length; i++) {
int a = target - nums[i];
if (map.get(a) != null) {
return new int[]{map.get(a), i};
}
map.put(nums[i], i);
}
return null;
}