Function to return the count of n digit perfect squares
function countSquares ( n ) { let r = Math . ceil ( Math . sqrt ( Math . pow ( 10 , n ) ) ) ; let l = Math . ceil ( Math . sqrt ( Math . pow ( 10 , n - 1 ) ) ) ; return r - l ; }