text: To store the states of the dp
code: var dp = Array . from ( Array ( MAX ) , ( ) => Array ( 101 ) ) ; for ( var i = 0 ; i < MAX ; i ++ ) for ( var j = 0 ; j < 101 ; j ++ ) dp [ i ] [ j ] = new Array ( 2 ) . fill ( - 1 ) ;