Function to return the count of numbers that when added with n give a perfect cube
function countPairsWith ( n , perfectcubes , nums ) { let count = 0 ; let len = perfectcubes . length ; for ( let i = 0 ; i < len ; i ++ ) { let temp = perfectcubes [ i ] - n ;