Find remaining character in B
for ( let i = 0 ; i < size_a ; i ++ ) freq [ A [ i ] . charCodeAt ( 0 ) ] -- ; for ( let j = ' ' . charCodeAt ( 0 ) ; j <= ' ' . charCodeAt ( 0 ) ; j ++ ) { if ( freq [ j ] < 0 ) return " " ; }