Stores all positive elements which are <= max_value
Dictionary < int , int > store = new Dictionary < int , int > ( ) ; for ( int i = 1 ; i <= max_value ; i ++ ) { if ( ! store . ContainsKey ( i ) ) store [ i ] = 0 ; store [ i ] ++ ; }