PYTHON SOL || EASY || BINARY CONVERSION || WELL EXPLAINED ||
EXPLANATION\n\nWhenever we need to convert any number in decimal form to any base we have a rule :\n\nwhile num ! = 0:\n   find remainder -> num % base\n   add 
# EXPLANATION\n```\nWhenever we need to convert any number in decimal form to any base we have a rule :\n\nwhile num ! = 0:\n   find remainder -> num % base\n   add remainder to ans \n   Now num becomes num // base\n   (Note take care in case of negation )\n reverse the ans to get the num in given base\n```\n# CODE\n```\nclass Solution:\n    def baseNeg2(self, n: int) -> str:\n        ans = ""\n        while n != 0:\n            if n%-2 != 0 :\n                ans = \'1\' + ans\n                n = (n-1)//-2\n            else:\n                ans = \'0\' + ans\n                n = n//-2\n        return ans if ans !="" else \'0\'\n```
['Python', 'Python3']