Update the frequencies of all the array elements
for ( int i = 0 ; i < n ; i ++ ) umap [ arr [ i ] ] ++ ; unordered_map < int , int > :: iterator itr ; for ( itr = umap . begin ( ) ; itr != umap . end ( ) ; itr ++ )