Skip to content

Instantly share code, notes, and snippets.

/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
let numObj = {}
for(i = 0; i < nums.length; i++) {
let other = target - nums[i];
if(numObj[other] !== undefined) {