text: Driver Code
code: let tab = Array ( 2000 ) . fill ( ) . map ( ( ) => Array ( 2000 ) . fill ( - 1 ) ) ; let n = 5 ; let a = [ 1 , 5 , 3 , 7 , 4 ] ; let sum = 12 ; if ( subsetSum ( a , n , sum ) ) { document . write ( " " + " " ) ; } else { document . write ( " " + " " ) ; }