Loading problem…
Pick the best time and space complexity.
function hasPairWithSum(nums, target) { const seen = new Set() for (const num of nums) { if (seen.has(target - num)) return true seen.add(num) } return false }