Traverse given string again and print all those characters whose frequency is more than or equal to k .
for ( int i = 0 ; i < n ; i ++ ) { if ( freq [ str [ i ] - ' a ' ] >= k ) { Console . Write ( str [ i ] ) ; } } }