Stores the frequencies as indexes and putelements with the frequency in a vector
List < int > [ ] freq = new List < int > [ n + 1 ] ; for ( int i = 0 ; i < freq . Length ; i ++ ) freq [ i ] = new List < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) {