Mark those characters which are not present in both lowercase and uppercase
unordered_map < char , int > mp ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( small [ i ] && ! caps [ i ] ) mp [ char ( i + ' a ' ) ] = 1 ; else if ( caps [ i ] && ! small [ i ] ) mp [ char ( i + ' A ' ) ] = 1 ; }