DP matrix
let cache = new Array ( 5 ) ; for ( let i = 0 ; i < 5 ; i ++ ) { cache [ i ] = new Array ( 5 ) ; for ( let j = 0 ; j < 5 ; j ++ ) { cache [ i ] [ j ] = new Array ( 5 ) ; for ( let k = 0 ; k < 5 ; k ++ ) { cache [ i ] [ j ] [ k ] = - 1 ; } } }