Boolean DP table to store result of states . dp [ i ] [ j ] = true if there is a subset of elements in first i elements of array that has sum equal to j .
var dp = Array . from ( Array ( n + 1 ) , ( ) => Array ( k + 1 ) ) ;