To store the frequency of the characters of str1
let freq = new Array ( MAX ) ; freq . fill ( 0 ) ; for ( let i = 0 ; i < len1 ; i ++ ) { freq [ str1 [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ] ++ ; }