def countBits(self, num):
:type num: int
return [bin(x)[2:].count('1') for x in range(num+1)]
Good solution, but it is still O(n*sizeof(integer)).
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.