문제
풀이
const twoSum = (nums, target) => {
for(let i = 0; i < nums.length; i++) {
for (let j = 1; j < nums.length; j++) {
if(nums[i] + nums[j] === target) {
return [i,j]
}
}
}
}
console.log(twoSum([4, 9, 11, 14], 13));
console.log(twoSum([7, 6, 3, 1], 7));