find the minimum frequency of every character in str1
for ( let i = 0 ; i < l2 ; i ++ ) { if ( freq2 [ str2 [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] != 0 ) count = Math . min ( count , freq [ str2 [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] / freq2 [ str2 [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ) ; } return count ; }