Traverse Strings str1 & str2 and store frequencies in a [ ] and b [ ]
for ( var j = 0 ; j < N ; j ++ ) { a [ str1 [ j ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ] ++ ; b [ str2 [ j ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ] ++ ; }