1. 可以把integer -> string -> char array. 2. 或者就 count += num << i & 1 Count how many 1 in binary representation of a 32-bit integer.