using System.Collections.Generic;
public static void Main()
int[] v = new int[] {2, 1, 8, 4, 7, 3};
static void test(int[] v, int val)
bool output = find_sum_of_two(v, val);
Console.WriteLine("exists(A, " + val + ") = " + output);
static bool find_sum_of_two(int[] A, int val)
HashSet<int> found_values = new HashSet<int>();
for(int i=0; i < A.Length; i++)
if(found_values.Contains(val - A[i]))