Stores all positive elements which are <= max_value
let store = new Map ( ) ; for ( let i = 1 ; i <= max_value ; i ++ ) { if ( ! store . has ( i ) ) store . set ( i , 0 ) ; store . set ( i , store . get ( i ) + 1 ) ; }