Algorithms

Subset sum

The problem of finding the groups of numbers in a list that add up exactly to a target. In a subset the order does not matter.

Example

With [3, 4, 5] and target 9, repeats allowed: {3, 3, 3} and {4, 5}. {5, 4} is the same as {4, 5}.

Test yourself: Subset sum

Subset sum

In a subset the ___ does not matter.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.