Advanced Conceptsbitmasksubset
Bitmasking and DP
Given n people, each willing to wear only certain caps drawn from a shared pool of cap types, count the number of ways to give every person a different cap, using only caps that person is willing to wear.
Do this lesson first: coin changeThe 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.