All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g0401_0500.s0461_hamming_distance.Solution Maven / Gradle / Ivy

There is a newer version: 1.24
Show newest version
package g0401_0500.s0461_hamming_distance;

// #Easy #Bit_Manipulation #Udemy_Bit_Manipulation
// #2022_07_19_Time_0_ms_(100.00%)_Space_40.9_MB_(60.77%)

public class Solution {
    public int hammingDistance(int x, int y) {
        return Integer.bitCount(x ^ y);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy