using System;
public class Program
{
public static void Main()
int[] nums = { 1, 2, 3, 4, 6 };
Console.WriteLine(FindThetarget(nums, 11));
}
private static bool FindThetarget(int[] arr, int tar)
int left = 0;
int right = arr.Length -1;
while(left < right)
int sum = arr[left]+arr[right];
if(sum == tar)
return true;
if(sum < tar)
left ++;
else
right --;
return false;