Function to return a number that contains only digit ' d ' repeated exactly count times
function getDistinct ( d , count ) { let num = 0 ; count = parseInt ( Math . pow ( 10 , count - 1 ) , 10 ) ; while ( count > 0 ) { num += ( count * d ) ; count = parseInt ( count / 10 , 10 ) ; } return num ; }