To store the frequency of characters of String str3
Dictionary < char , int > freq = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < str3 . Length ; i ++ ) { if ( freq . ContainsKey ( str3 [ i ] ) ) freq [ str3 [ i ] ] = freq [ str3 [ i ] ] + 1 ; else freq . Add ( str3 [ i ] , 1 ) ; }