Driver Code
let mod = ( 1e9 + 7 ) ; let n = 4 , k = 2 ; let dp = new Array ( n + 1 ) . fill ( 0 ) ; for ( let i = 0 ; i < n + 1 ; i ++ ) dp [ i ] = - 1 ; let ans = solve ( n , k , mod , dp ) ; document . write ( ans ) ;