JavaScript program to implement the above approach
function isSubsetSum ( arr , n , sum ) { let subset = new Array ( n + 1 ) ; for ( var i = 0 ; i < subset . length ; i ++ ) { subset [ i ] = new Array ( 2 ) ; }