Creating Main Class
public static void Main()
{
int[] ar = new int[]{ 3, 1, 4, 6, 5 };
int ar_size = ar.Length;
if (isTriplet(ar, ar_size) == true)
Console.WriteLine("Yes");
else
Console.WriteLine("No");
}
isTriplet function will search for triplet can satisfies pyhtagoras equation. There are two ways to make this works. We can use brute force, or use sorting method.