Loop to find the maximum Repeated frequency from hash - map
int max_count = 0 , res = -1 ; for ( auto i : hash ) { if ( max_count < i . second ) { res = i . first ; max_count = i . second ; } } cout << " Frequency ▁ " << res << " ▁ is ▁ repeated ▁ " << max_count << " ▁ times " ; }