var twoSum = function(nums, target) {
let mapping = {}
for(let i = 0; i < nums.length; i++) {
if(target - nums[i] in mapping) {
return [mapping[target-nums[i]],i]
} else {
mapping[nums[i]] = i
}
}
return []
};