100% Fast C++ Easy Understand Solution with abs() and ceil()
My solution does not have multiple if-statements or mathematical proof. It is just an intuitive short solution.\n\nc++\nclass Solution {\npublic:\n    string ba
My solution does not have multiple if-statements or mathematical proof. It is just an intuitive short solution.\n\n```c++\nclass Solution {\npublic:\n    string baseNeg2(int n) {\n        if (!n) {\n            return "0";\n        }\n        string res;\n        while (n != 0) {\n            res.push_back(abs(n % -2) + \'0\');\n            n = ceil(n / -2.0);\n        }\n        reverse(res.begin(), res.end());\n        return res;\n    }\n};\n```
[]