Short and Simple C++ Solution
\nclass Solution {\npublic:\n    string baseNeg2(int n) {\n        string str="";\n        while(n)\n        {\n            int rem=n%(-2);\n            n/=(-2)
```\nclass Solution {\npublic:\n    string baseNeg2(int n) {\n        string str="";\n        while(n)\n        {\n            int rem=n%(-2);\n            n/=(-2);\n            if(rem<0) {rem+=2;n++;}      //increase the quotient by 1 to make the remainder positive.\n            str=to_string(rem)+str;\n        }\n        return str==""?"0":str;\n    }\n};\n```
[]