Stores all positive elements which are <= max_value
Map < Integer , Integer > store = new HashMap < > ( ) ; for ( int i = 1 ; i <= max_value ; i ++ ) { store . put ( i , store . getOrDefault ( i , 0 ) + 1 ) ; }