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