python 36ms


  • 0
    L
        a = str(bin(x)).lstrip('0b').zfill(32)
        b = str(bin(y)).lstrip('0b').zfill(32)
        c = [i for i, j in zip(a, b) if i == j]
        return(32 - len(c))

Log in to reply
 

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