Solución
solution.tsTypeScript
function hasPairWithSum(numbers: number[], target: number): boolean {
// TODO: Implementa tu solución aquí
const vistos = new Set<number>();
for (const n of numbers) {
if (vistos.has(target - n)) return true;
vistos.add(n);
}
return false;
}
// No modificar: necesario para evaluar el resultado.
export { hasPairWithSum };0respuestas