0ms Solution || FASTER THAN 100% || C++
\nclass Solution {\npublic:\n    string baseNeg2(int n) {\n        if(n == 0) \n            return "0";\n        string ans = "";\n        while(n)\n        {\n
```\nclass Solution {\npublic:\n    string baseNeg2(int n) {\n        if(n == 0) \n            return "0";\n        string ans = "";\n        while(n)\n        {\n            int rem = n % -2;\n            if(rem < 0)\n            {\n                rem += 2;\n                n--; \n            }\n            ans = to_string(rem) + ans;\n            n = n / -2;\n        }\n        return ans;\n    }\n};\n```
[]