Stores the count of frequencies of all the array elements
Dictionary < int , int > freq = new Dictionary < int , int > ( ) ; foreach ( int i in arr ) { if ( freq . ContainsKey ( i ) ) freq [ i ] += 1 ; else freq [ i ] = 1 ; }