Solution by Xor


  • 0
    P
    class Solution {
        public int hammingDistance(int x, int y) {
            int z = x ^ y;
            return Integer.bitCount(z);
            
        }
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.