Given two integer arrays like this:-
int[] a = { 2, 6, 10, 13, 17,18 }; int[] b = { 3, 7, 8, 9, 11, 15 };
How can I find pai
I managed to simplify it using LINQ:
int[] arr1 = { 2, 6, 10, 13, 17, 18 }; int[] arr2 = { 3, 7, 8, 9, 11, 15 }; int count = arr1.Sum(t => (from t1 in arr2 select t*t1 into x let s = (long) Math.Sqrt(x) where x == s*s select x).Count());