diff --git a/Programs/Minimum subsetsum difference (Dynamic Progrmming).cpp b/Programs/Minimum subsetsum difference (Dynamic Progrmming).cpp new file mode 100644 index 00000000..65144597 --- /dev/null +++ b/Programs/Minimum subsetsum difference (Dynamic Progrmming).cpp @@ -0,0 +1,58 @@ +//Minimum subsetsum difference -> DP (Dynamic Progrmming) + +#include +using namespace std; +#define ll long long + +void minsub(vectora) +{ + ll n=a.size(); + ll s=0; + for(ll i=0;i=0;--i) + { + if(dp[n][i]==true) + { + k=i; + break; + } + } + k=s-2*k; + cout<<"The Minimum Subset Difference of the given Array is : "<>n; + vectorv; + ll a; + for(ll i=0;i>a; + v.push_back(a); + } + minsub(v); + //happy coding +}