PYTHON


  • 0
    W
    class Solution(object):
        def findComplement(self, num):
            i='{:b}'.format(num)
            m=len(i)
            a=int('1'*m,2)
            return a^num
    

Log in to reply
 

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