Practice problem: given an array of positive integers and a target sum , count how many subsets sum exactly to . This is the counting version of Partition.
Let = number of subsets summing to . Base case: (empty subset). Transition: for each element , update for from target down to . Try it on with target . Expected answer: subsets (, , ).