Python Solution, 42ms


  • 0
    M

    I viewed other ppl's 1 line solutions, impressive, but my solution is even faster, 42ms

            s = bin(x ^ y)
            return len([x for x in s if x == '1'])
    

Log in to reply
 

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