Rule based
Intuition\n Describe your first thoughts on how to solve this problem. \nRule based solution\n\n\n\n\n# Complexity\n- Time complexity: O(n)\n Add your time comp
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nRule based solution\n\n\n\n\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def addNegabinary(self, arr1: List[int], arr2: List[int]) -> List[int]:\n        l = max(len(arr1), len(arr2)) + 2\n        arr1 = [0] * (l - len(arr1)) + arr1\n        arr2 = [0] * (l - len(arr2)) + arr2\n\n        res = [0] * l\n        for i in range(l-1, -1, -1):\n            if arr1[i] + arr2[i] + res[i] == 3:\n                res[i] = 1\n                res[i-1] -= 1\n            elif arr1[i] + arr2[i] + res[i] == 2:\n                res[i] = 0\n                res[i-1] -= 1\n            elif arr1[i] + arr2[i] + res[i] == 1:\n                res[i] = 1\n            elif arr1[i] + arr2[i] + res[i] == 0:\n                res[i] = 0\n            elif arr1[i] + arr2[i] + res[i] == -1:\n                res[i] = 1\n                res[i-1] = 1\n            \n        for i in range(l):\n            if res[i] != 0:\n                return(res[i:])\n        return([0])\n\n\n\n\n\n\n\n```
['Python3']