using System.Collections.Generic;
static bool HasPairWithSum(int[] numbers, int k)
HashSet<int> seenNumbers = new HashSet<int>();
foreach (int num in numbers)
int complement = k - num;
if (seenNumbers.Contains(complement))
int[] numbers = { 10, 2, 6, 13 };
bool result = HasPairWithSum(numbers, k);
Console.WriteLine(result ? "Yes, there is a pair." : "No, there isn't a pair.");