simple java 100%
\nthe only thing we need to know is that the carry populates to two digits to the left\n    [1]\n+   [1]\n--------\n[1,1,0]\n\n\n```\nclass Solution {\n    publ
```\nthe only thing we need to know is that the carry populates to two digits to the left\n    [1]\n+   [1]\n--------\n[1,1,0]\n```\n\n```\nclass Solution {\n    public int[] addNegabinary(int[] arr1, int[] arr2) {\n        int carry = 0;\n        int l1 = arr1.length-1;\n        int l2 = arr2.length-1;\n        int[] res = l1>=l2 ? arr1 : arr2;\n        int idx = l1>=l2 ? l1 : l2;\n        while(l1>=0 || l2>=0){\n            int val1 = l1>=0 ? arr1[l1] : 0;\n            int val2 = l2>=0 ? arr2[l2] : 0;\n            int val = val1 + val2;\n            if(carry > 0){\n                if(carry == 2){\n                    carry = val > 0 ? 0 : 1;\n                    val = val > 0 ? val-1 : 1;\n                }else{\n                    carry = val > 0 ? 2 : 0;\n                    val = val > 0 ? val-1 : 1;\n                }\n            }else{\n                if(val == 2){\n                    val = 0;\n                    carry = 2;\n                }\n            }\n            res[idx--] = val;\n            l1--;\n            l2--;\n        }\n        int start = 0;\n        if(carry > 0){\n            int[] resExt = new int[res.length+2];\n            resExt[0] = 1;\n            resExt[1] = 1;\n            start += 2;\n            for(int i : res)\n                resExt[start++] = i;\n            return resExt;\n        }else{\n            while(res[start]==0 && start != res.length-1)\n                start++;\n            return Arrays.copyOfRange(res, start, res.length);\n        }\n    }\n}
[]