No sultion exists
return 0 ; let dp = new Array ( parseInt ( ( S + sum ) / 2 , 10 ) + 1 ) ; dp . fill ( 0 ) ; dp [ 0 ] = 1 ; for ( let num = 0 ; num < nums . length ; num ++ ) { for ( let i = dp . length - 1 ; i >= nums [ num ] ; i -- ) { dp [ i ] += dp [ i - nums [ num ] ] ; } }