iterate through the second string update char_count . if character is not found in char_count then increase count
for ( int i = 0 ; i < s2 . length ( ) ; i ++ ) { char_count [ s2 [ i ] - ' a ' ] -- ; } for ( int i = 0 ; i < 26 ; ++ i ) { if ( char_count [ i ] != 0 ) { count += abs ( char_count [ i ] ) ; } } return count / 2 ; }