Function which checks if a digits exists in n which is the average of all other digits
static void check ( int n ) { HashSet < int > digits = new HashSet < int > ( ) ; int temp = n ; int sum = 0 ; int count = 0 ; while ( temp > 0 ) {