Easy
Given an integer n, return an array ans of length n + 1 where ans[i] is the number of 1-bits in the binary representation of i.
n
ans
n + 1
ans[i]
1
i
Input: n = 2 Output: [0,1,1]
Input: n = 5 Output: [0,1,1,2,1,2]