javascript O(n) solution
\n/**\n * @param {number[]} arr1\n * @param {number[]} arr2\n * @return {number[]}\n */\nvar addNegabinary = function(arr1, arr2) {\n     // making array size e
```\n/**\n * @param {number[]} arr1\n * @param {number[]} arr2\n * @return {number[]}\n */\nvar addNegabinary = function(arr1, arr2) {\n     // making array size equal\n      if(arr1.length > arr2.length) {\n          arr2 = new Array(arr1.length - arr2.length).fill(0).concat(arr2);\n      }\n      else {\n          arr1 = new Array(arr2.length - arr1.length).fill(0).concat(arr1);\n      }\n      let carry = 0;\n      let result = [];\n\t  // carry 1 + 1 = -1  \n      for(let i = arr2.length - 1; i >= 0; i--) {\n          sum = carry + arr2[i] + arr1[i];\n          carry = 0;\n          if(sum > 1){\n              carry = -1;\n          }\n          else if(sum < 0){\n              carry = 1;\n              sum = 1;\n          }\n          result.push(sum %2);\n      }\n      \n      if( carry == -1) {\n          result.push(1,1)\n      }\n    \n      if( carry == 1) {\n          result.push(1)\n      }\n    let t = 0;\n    for(let i = result.length-1; i >= 0; i--) {\n        if(result[i] === 1)\n            break;\n        t++;\n    }\n    if(t === result.length) {\n        return [0];\n    }\n    return result.reverse().slice(t);\n};\n\n```\n
[]