For every i from 0 to n, output the number of 1 bits in i. Aim for O(n) total — better than calling popcount n times.
Input: one line, the integer n.
Output: n+1 counts, space-separated.
2
0 1 1
5
0 1 1 2 1 2
Run your code against the sample tests, or Submit to run the full suite.