Cloze

Counting Bits

Dynamic programming on bits · O(n) time, O(n) space · LeetCode ↗

For every number from 0 to n, count the bits that are 1 in its binary form, and return the counts as a list.