Share your repls and programming experiences

← Back to all posts
The subset sum problem (my solution)
rafrafraf (1369)

The challenge is to find every subset of numbers in a set that add up to a target number.

The default target number and set in my algorithm are 16 and 1,2,3,4,5,6,7.

The subsets can be any length, and in this case my solution works on all real numbers (positive/negative and int/float)

I regret thinking this was easy when I started it...

Check it out and if you try to make your own solution comment the link below!

P.S this is not efficient at all and I plan on remaking it soon with a different solution.