Python beats 98%
Intuition\nSimple long addition. Go through digits from right to left, remember to carry. Take special care with carry, which can be both +1 and -1, and remembe
# Intuition\nSimple long addition. Go through digits from right to left, remember to carry. Take special care with carry, which can be both +1 and -1, and remember to flip carry sign.\n\n# Complexity\n- Time complexity: $O(n)$\n\n- Space complexity: $O(1)$\n\n# Code\n```\nclass Solution:\n    def addNegabinary(self, arr1: List[int], arr2: List[int]) -> List[int]:\n        mem = 0\n        arr3 = []\n        for j in range(max(len(arr1), len(arr2))):\n            arr1i = len(arr1) - 1 - j\n            arr2i = len(arr2) - 1 - j\n\n            arr3v = (\n                (arr1[arr1i] if arr1i >= 0 else 0)\n                + (arr2[arr2i] if arr2i >= 0 else 0)\n                + mem\n            )\n            \n            if arr3v == -1:\n                arr3.append(1)\n                mem = 1\n            else:\n                mem = -(arr3v // 2)\n                arr3.append(arr3v % 2)\n        if mem == -1:\n            arr3.append(1)\n            arr3.append(1)\n        if mem == 1:\n            arr3.append(1)\n        while len(arr3) >= 2 and arr3[-1] == 0:\n            arr3.pop()\n        return reversed(arr3)\n```
['Python3']