Counting frequency of characters in each string .
for ( var i = 0 ; i < l ; i ++ ) { countx [ X [ i ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ] ++ ; county [ Y [ i ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ] ++ ; }