Push all the strings into the Unordered Map
let s = new Map ( ) ; for ( let i = 0 ; i < n ; i ++ ) { if ( ! s . has ( a [ i ] ) ) s . set ( a [ i ] , 0 ) ; s . set ( a [ i ] , s . get ( a [ i ] ) + 1 ) ; }