Function to validate number ( Check iffrequency of a digit is less than thedigit itself or not )
static bool validate ( long n ) { for ( int i = 0 ; i < 10 ; i ++ ) { long temp = n ; int count = 0 ; while ( temp > 0 ) {