No sultion exists
return 0 ; int [ ] dp = new int [ ( S + sum ) / 2 + 1 ] ; dp [ 0 ] = 1 ; foreach ( int num in nums ) { for ( int i = dp . Length - 1 ; i >= num ; i -- ) { dp [ i ] += dp [ i - num ] ; } }