Function to return the count of numbers that when added with n give a perfect square
public static int countPairsWith ( int n , ArrayList perfectSquares , ArrayList nums ) { int count = 0 ; for ( int i = 0 ; i < perfectSquares . Count ; i ++ ) { int temp = ( int ) perfectSquares [ i ] - n ;