Driver Code
let N = 5 ; let K = 3 ; let dp = new Array ( K + 1 ) ; for ( i = 0 ; i < dp . length ; i ++ ) { dp [ i ] = new Array ( N + 1 ) ; } for ( i = 0 ; i < dp . length ; i ++ ) { for ( j = 0 ; j < dp [ 0 ] . length ; j ++ ) { dp [ i ] [ j ] = new Array ( 2 ) . fill ( - 1 ) ; } }