JavaScript Program to Paint N boxes using M colors such that K boxes have color different from color of box on its left
let m = 1001 ; let MOD = 998244353 ; let dp = new Array ( m ) ; for ( let i = 0 ; i < m ; i ++ ) { dp [ i ] = new Array ( m ) ; for ( let j = 0 ; j < m ; j ++ ) { dp [ i ] [ j ] = 0 ; } }