Initializing the dp table and setting all values to 0
let dp = new Array ( N ) . fill ( 0 ) . map ( ( ) => new Array ( MAX ) ) ; for ( let i = 0 ; i < N ; i ++ ) for ( let j = 0 ; j < MAX ; j ++ ) dp [ i ] [ j ] = 0 ;