Python 6 line solution, O(bits)time
https://en.wikipedia.org/wiki/Negative_base#Calculation\n\n\nclass Solution(object):\n    def baseNeg2(self, N):\n        rval = \'\'\n        while N != 0:\n  
https://en.wikipedia.org/wiki/Negative_base#Calculation\n\n```\nclass Solution(object):\n    def baseNeg2(self, N):\n        rval = \'\'\n        while N != 0:\n            remainder = -N % 2\n            N = (N - remainder) / -2\n            rval = str(remainder) + rval\n        return rval if rval else \'0\'\n```
[]