Loop to find the maximum Repeated frequency from hash - map
int max_count = 0 , res = - 1 ; foreach ( KeyValuePair < int , int > i in hash ) { if ( max_count < i . Value ) { res = i . Key ; max_count = i . Value ; } } Console . WriteLine ( " Frequency ▁ " + res + " ▁ is ▁ repeated ▁ " + max_count + " ▁ times " ) ; }