Ordinary add and carry works just fine!
Ordinary add and carry works just fine! You just need to realize that carry could be some number other than zero or one and that you only have to subtract the r
Ordinary add and carry works just fine! You just need to realize that carry could be some number other than zero or one and that you only have to subtract the right signed bit if it\'s not even before dividing by 2.\n\n```csharp\npublic class Solution {\n    public int[] AddNegabinary(int[] arr1, int[] arr2) {\n        arr1 = arr1.Reverse().ToArray();\n        arr2 = arr2.Reverse().ToArray();\n        var arr3 = new int[Math.Max(arr1.Length, arr2.Length) + 4];\n        var carry = 0;\n        for (var i = 0; i < arr3.Length; i++) {\n            var sign = i % 2 == 0 ? 1 : -1;\n            var bit1 = i < arr1.Length ? sign * arr1[i] : 0;\n            var bit2 = i < arr2.Length ? sign * arr2[i] : 0;\n            var sum = bit1 + bit2 + carry;\n            var bit3 = sum % 2 == 0 ? 0 : 1;\n            arr3[i] = bit3;\n            sum -= sign * bit3;\n            carry = sum / 2;\n        }\n        var len = arr3.Length;\n        while (len > 1 && arr3[len - 1] == 0) len -= 1;\n        arr3 = arr3.Take(len).Reverse().ToArray();\n        return arr3;\n    }\n}```
[]