Return the maximum difference between frequencies of any two elements such that element with greater frequency is also greater in value .
int maxdiff ( int arr [ ] , int n ) { unordered_map < int , int > freq ; int dist [ n ] ;