class Solution:

    def findComplement(self, num):
        """
        :type num: int
        :rtype: int
        """
        return int(''.join(str(1 - int(n)) for n in bin(num)[2:]), 2)


if __name__ == '__main__':
    print(Solution().findComplement(5) == 2)

b2914dc6cc8124008ef96958773b97af580a8459
<mask token>

class Solution:
    <mask token>


<mask token>

class Solution:

    def findComplement(self, num):
        """
        :type num: int
        :rtype: int
        """
        return int(''.join(str(1 - int(n)) for n in bin(num)[2:]), 2)


<mask token>

class Solution:

    def findComplement(self, num):
        """
        :type num: int
        :rtype: int
        """
        return int(''.join(str(1 - int(n)) for n in bin(num)[2:]), 2)


if __name__ == '__main__':
    print(Solution().findComplement(5) == 2)
