@@ -0,0 +1,577 @@
+package leetcode;%0A%0A/**%0A * https://leetcode.com/problems/number-of-1-bits/%0A */%0Apublic class Problem191 %7B%0A    public int hammingWeight(int n) %7B%0A        int result = 0;%0A        int x = n;%0A        for (int i = 0; i %3C 32; i++) %7B%0A            if ((x & 1) == 1) %7B%0A                result++;%0A            %7D%0A            x %3E%3E= 1;%0A        %7D%0A        return result;%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        Problem191 prob = new Problem191();%0A        System.out.println(prob.hammingWeight(11));%0A        System.out.println(prob.hammingWeight((int) 2147483648L));%0A    %7D%0A%7D%0A

Solve problem 191