Counting Bits
Examples
Example 1:
Input: n = 4
Output: [0,1,1,2,1]
Explanation:
Example 1:
Input: n = 4
Output: [0,1,1,2,1]
Explanation:
Given an integer n, count the number of 1's in the binary representation of every number in the range [0, n].
Return an array output where output[i] is the number of 1's in the binary representation of i.
0 --> 0 1 --> 1 2 --> 10 3 --> 11 4 --> 100
0 <= n <= 1000