ok ^^
\n\n\n\n\nstring baseNeg2(int n) \n{\n\tstring out{};\n\tfor(int c{0}, i{0}; n or c; n>>=1, ++i)\n\t{\n\t\tc += n&1;\n\t\tout.push_back(\'0\'+(c&1));\n\t\tc = (
<br>\n\n![image](https://assets.leetcode.com/users/images/e53dda3a-aa6b-4737-9d39-aedaeb084dbf_1619400123.5964506.png)\n\n```\nstring baseNeg2(int n) \n{\n\tstring out{};\n\tfor(int c{0}, i{0}; n or c; n>>=1, ++i)\n\t{\n\t\tc += n&1;\n\t\tout.push_back(\'0\'+(c&1));\n\t\tc = (i&1 ? c+(c&1) : c)/2;\n\t}\n\treverse(begin(out), end(out));\n\treturn empty(out) ? "0"s : out; \n}\n```\n`c` - carry, `s` - sum, `i` - index for parity control.
['C', 'C++']