Advanced Conceptsbitmasksubsetcounting

Sum over Subsets

Given an array indexed by every bitmask from 0 to 2^n - 1, compute for each mask the sum of array values at all masks that are subsets of it, meaning a subset mask has a 1 bit only where the original mask also does.

Do this lesson first: coin change

The full breakdown and animated table for this problem are still being written. In the meantime, run the four questions on it yourself — that is the whole exercise.