Posted on September 23, 2020September 23, 2020 Description Submission class Solution { public: int hammingWeight(uint32_t n) { int total = 32; int count = 0; while(total-- > 0) { count += (n & 1); n >>= 1; } return count; } }; By Bill0412 Easy LeetCode