19 / 26
read the snippet · pick its Big-O
function twoSum(prices, target) {const seen = new Map();for (let i = 0; i < prices.length; i++) {const need = target - prices[i];if (seen.has(need)) return [seen.get(need), i];seen.set(prices[i], i);}return null;}