using System;
using FluentAssertions;
using System.Xml.Linq;
public class Program
{
public static void Main()
//#1
var arr = new int[]{10, 15, 3, 7};
Problem_1_Easy(arr,17).Should().BeTrue();
Problem_1_Easy(arr,18).Should().BeFalse();
}
public static bool Problem_1_Easy(int[] arr, int k){
Array.Sort<int>(arr);
int i = 0;
int j = arr.Length-1;
while (i<j){
var currentCalc = arr[i] + arr[j];
if (currentCalc == k)
return true;
if (currentCalc < k)
i++;
if (currentCalc > k)
j--;
return false;