src/main/java/com/leetcode/bitmanipulation/easy/NumberOf1Bits_191.java
public int hammingWeight(int n) {
    int result = 0;
    while (n != 0) {
      result += (n & 1);
      n = n >>> 1;
    }
    return result;
  }
// you need to treat n as an unsigned value
you need to treat n as an unsigned value
you need to treat n as an unsigned value
public int hammingWeight(int n) {
    int result = 0;
    while (n != 0) {
      result += (n & 1);
      n = n >>> 1;
    }
    return result;
  }
public int hammingWeight ( int n ) { int result = 0 ; while ( n != 0 ) { result += ( n & 1 ) ; n = n >>> 1 ; } return result ; }
you need to treat n as an unsigned value
you need to treat n as an unsigned value