Easy - Two Sum
https://leetcode.com/problems/two-sum/description/
Answer
var twoSum = function (nums, target) {
let map = {};
for (let i = 0; i < nums.length; i++) {
const sum = target - nums[i];
if (sum in map) {
return [map[sum], i];
} else {
map[nums[i]] = i;
}
}
};