Given an array and a target, assign + or - to each number so they sum to target. Return the count of ways to do this. For example, with and target , there are ways. This looks like a different problem entirely. You're assigning signs, not selecting subsets.
But there's a clever transformation hiding here. Before reading the solution, try this: if you call the numbers with + signs "" and numbers with - signs "", what equations can you write?