Given an integer `n`, return an array `ans` of length `n + 1` such that for each `i` (`0 <= i <= n`), `ans[i]` is the number of `1`'s in the binary representation of `i`.
Dynamic Programming (Bitwise)
The number of set bits in `i` is related to the number of set bits in `i >> 1` (which is `i/2`). Specifically, `bits[i] = bits[i >> 1] + (i & 1)`. The term `(i & 1)` is 1 if `i` is odd and 0 if `i` is even.