Stores the results
var dp = Array . from ( Array ( maxN ) , ( ) => Array ( maxN ) ) ; for ( var i = 0 ; i < maxN ; i ++ ) for ( var j = 0 ; j < maxN ; j ++ ) dp [ i ] [ j ] = new Array ( maxN ) . fill ( - 1 ) ;