class Solution {
    public int hammingDistance(int x, int y) {
        int result = x ^ y;
        //String binaryResult = Integer.toBinaryString(result);
        //return binaryResult.length() - binaryResult.replace("1", "").length();
        //return binaryResult.replace("0", "").length();
        return Integer.bitCount(result);
    }
}

@@ -1,8 +1,432 @@
+/**%0A *The Hamming distance between two integers is the number of positions at which the corresponding bits are different.%0A *%0A *Given two integers x and y, calculate the Hamming distance.%0A *%0A *Note:%0A *0 %E2%89%A4 x, y %3C 231.%0A *%0A *Example:%0A *%0A *Input: x = 1, y = 4%0A *%0A *Output: 2%0A *%0A *Explanation:%0A *1   (0 0 0 1)%0A *4   (0 1 0 0)%0A *       %E2%86%91   %E2%86%91%0A *%0A *The above arrows point to positions where the corresponding bits are different.%0A */%0A
 class So

add annotation