Same Subset sum

Anyone please help me with solution of the problem:

Given a set ,we need to print all subsets having equal sum?
I found on geeksforgeeks where K(number of partitions) was given.

1 Like

Well, without partition count, i believe this problem in NP-hard as you have to decide how many parititions, what sum to obtain in each partition as well as size of partition…

If sum is given to you, then it is a standard problem with a dp solution which you can find here

If Number of partition is given to you, then you can refer this link which you yourself mentioned, here.

Please UPVOTE and Accept if you find this helpful…

Feel free to ask anything… :slight_smile:

1 Like

solution of my problem is not that easy ?

If you wanna ask anything else regarding this question, please ask,

else Accept the answer, so i would know your doubts are clear…

Well, your problem can be solved, given all the numbers do not exceed a small limit, say 1000000, but for larger limits, the best algorithms known would time out, as i know…

It’s not a matter of being easy…

You can easily make a solution for small limit (though i haven’t made yet) but it will give TLE on larger limits…

//