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

g0401_0500.s0461_hamming_distance.Solution.kt Maven / Gradle / Ivy

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

// #Easy #Bit_Manipulation #Udemy_Bit_Manipulation
// #2022_12_27_Time_150_ms_(96.15%)_Space_32.9_MB_(92.31%)

class Solution {
    fun hammingDistance(x: Int, y: Int): Int {
        return Integer.bitCount(x xor y)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy