Check whether frequency of any two or more elements are same or not . If yes , return false
for ( let [ key , value ] of freq . entries ( ) ) { if ( uniqueFreq . has ( value ) ) return false ; else uniqueFreq . add ( value ) ; }