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