Table to store the solution of every sub problem
var memo = Array . from ( Array ( 32 ) , ( ) => Array ( 2 ) ) ; for ( var i = 0 ; i < 32 ; i ++ ) { for ( var j = 0 ; j < 2 ; j ++ ) { memo [ i ] [ j ] = new Array ( 2 ) . fill ( - 1 ) ; } }