🔥 Simple Javascript Solution - Easy to Understand
\nfunction addNegabinary(a, b) {\n    // reverse first\n    a = a.reverse(), b = b.reverse();\n\n    // set c as third array, get max as number of loops\n    le
```\nfunction addNegabinary(a, b) {\n    // reverse first\n    a = a.reverse(), b = b.reverse();\n\n    // set c as third array, get max as number of loops\n    let c = dp(Math.max(a.length, b.length));\n\n    // remove 0\n    while (c.length > 1 && c[0] == 0) {\n        c.shift();\n    }\n\n    // result\n    return c;\n\n    // dp\n    function dp(max, r = []) {\n        for (let i = 0; i <= max; i++) {\n            // fault-tolerant\n            r[i] = (a[i] || 0) + (b[i] || 0) + (r[i] || 0);\n\n            if (r[i] == -1) {\n                r[i] = 1;\n                r[i + 1] = 1;\n                continue;\n            }\n\n            if (r[i] == 2) {\n                r[i] = 0;\n                r[i + 1] = -1;\n                continue;\n            }\n\n            if (r[i] == 3) {\n                r[i] = 1;\n                r[i + 1] = -1;\n                continue;\n            }\n        }\n        return r.reverse();\n    }\n};\n```
['JavaScript']