Finding minimum number of changes required .
unordered_map < int , int > :: iterator itr = mp . begin ( ) ; int changes = 0 ; for ( ; itr != mp . end ( ) ; itr ++ ) changes = max ( changes , itr -> second ) ;