class Solution: def findComplement(self, num): """ :type num: int :rtype: int """ binaryX = bin(num)[2:] binaryX = int(binaryX,2) ^ int("1"*len(binaryX),2) return binaryX