Python Solution, 42ms


  • 0
    M

    I viewed other people's solutions, impressive, but mine is even faster. 42ms

    s = bin(x ^ y)[2:]
    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.