Given an integer n, return an array of length n+1 where ans[i] is the number of 1s in the binary representation of i.
5
0 1 1 2 1 2
[0, 1, 1, 2, 1, 2]