C++ in-place modification, time O(n), space O(1)
Binary add has only 5 cases:\n\n//value:0, binary: 0 0 0 -> 0 0 0\n//value:1, binary: 0 0 1 -> 0 0 1\n//value:-1, binary:  0 0 -1 -> 0 1 1\n//vaue: 2, binary 0 
Binary add has only 5 cases:\n```\n//value:0, binary: 0 0 0 -> 0 0 0\n//value:1, binary: 0 0 1 -> 0 0 1\n//value:-1, binary:  0 0 -1 -> 0 1 1\n//vaue: 2, binary 0 0 2 -> 0 -1 0 -> 1 1 0\n//value: 3, binary 0 0 3 -> 0 -1 1 -> 1 1 1\n```\n```\nclass Solution {\npublic:\n    vector<int> addNegabinary(vector<int>& arr1, vector<int>& arr2) {\n       if (arr1.size() > arr2.size()) swap(arr1,arr2);\n        arr2.insert(arr2.begin(), 3, 0);\n        for (int i = arr1.size()-1, j = arr2.size()-1; j>=0; i--, j--) {\n            if (i>=0) arr2[j]+=arr1[i];\n            if (arr2[j] == -1) {\n                arr2[j] = 1;\n                arr2[j-1]++;\n            } else if (arr2[j] == 2) {\n                arr2[j] = 0;\n                arr2[j-1]--;\n            } else if (arr2[j] == 3) {\n                arr2[j] = 1;\n                arr2[j-1]--;\n            }\n        }\n        while (arr2.front() == 0 && arr2.size()>1) arr2.erase(arr2.begin());\n        return arr2;\n    }\n};\n```
[]