To store the frequency of characters of String str3
let freq = new Map ( ) ; for ( let i = 0 ; i < str3 . length ; i ++ ) { if ( freq . has ( str3 [ i ] ) ) freq . set ( str3 [ i ] , freq . get ( str3 [ i ] ) + 1 ) ; else freq . set ( str3 [ i ] , 1 ) ; }