@staticmethod
    def natural_num_to_bin(n):
        """

        :type n: int
        :param n:
        :return: string representation
        """
        sb = []  # string buffer
        while 0 > n:
            sb.append(n&1)
            n >>= 1

        return "".join(map(str, reversed(sb)))
dataset/ETHPy150Open algorhythms/LintCode/Binary Representation.py/Solution.natural_num_to_bin/swapped operands of `>`