{
class Solution {
public int[] twoSum(int[] nums, int target) {
int a[] = new int[2] ;
HashMap<Integer,Integer> numsMap = new HashMap<>();
for(int i = 0; i < nums.length;i++){
int b = target - nums[i];
if(numsMap.containsKey(b)){
a[0] = i;
a[1] = numsMap.get(b);
return a;
}
numsMap.put(nums[i],i);
}
return a;
}
}
}