Driver Code
let data = [ 3 , 1 , 7 , 1 , 2 ] ; let target = 11 ; let val = smallSumSubset ( data , target , data . length + 1 ) ; if ( val > data . length ) document . write ( - 1 ) ; else document . write ( val ) ;