Check whether frequency of any two or more elements are same or not . If yes , return false
for ( auto & i : freq ) { if ( uniqueFreq . count ( i . second ) ) return false ; else uniqueFreq . insert ( i . second ) ; }