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