Let's solve the Counting Bits problem using the Dynamic Programming pattern.

Statement