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