Resizing the variables
for ( let i = 0 ; i < k ; i ++ ) { exp_c . push ( 0 ) ; } exp_c [ 0 ] = 1 ; for ( let i = 1 ; i < k ; i ++ ) { exp_c [ i ] = ( exp_c [ i - 1 ] * ( c + 1 ) ) ; } for ( let i = 0 ; i < n ; i ++ ) { dp . push ( [ ] ) ; } for ( let i = 0 ; i < n ; i ++ ) { for ( let j = 0 ; j < ( exp_c [ k - 1 ] * ( c + 1 ) ) ; j ++ ) { dp [ i ] [ 0 ] ; } } for ( let i = 0 ; i < n ; i ++ ) { v . push ( [ ( exp_c [ k - 1 ] * ( c + 1 ) ) ] ) ; } for ( let i = 0 ; i < n ; i ++ ) { for ( let j = 0 ; j < v [ i ] . length ; j ++ ) { v [ i ] [ j ] = false ; } }