Removing all unnecessary digits
for ( int j = 0 ; j < size ; j ++ ) { if ( test [ j ] == x + 48 test [ j ] == y + 48 ) { newtest += test [ j ] ; } } if ( newtest . size ( ) > 0 ) { int size1 = newtest . size ( ) ;