A lookup table used for memoization .
let lookup = new Array ( 50 ) ; for ( let i = 0 ; i < 50 ; i ++ ) { lookup [ i ] = new Array ( 1000 ) ; for ( let j = 0 ; j < 1000 ; j ++ ) { lookup [ i ] [ j ] = new Array ( 1000 ) ; for ( let k = 0 ; k < 1000 ; k ++ ) { lookup [ i ] [ j ] [ k ] = new Array ( 2 ) ; } } }