text: map is used to store character frequencies
code: let m = new Map ( ) ; for ( i = 0 ; i < s . length ; i ++ ) m . set ( s [ i ] , m . get ( s [ i ] ) == null ? 1 : m . get ( s [ i ] ) + 1 ) ; let sum = 0 , product = 1 ;