C++ easy to understand and concise solution
\tclass Solution {\n\tpublic:\n\t\tvector addNegabinary(vector& arr1, vector& arr2) {\n\t\t\treverse(arr1.begin(),arr1.end());\n\t\t\treverse(arr2.begin(),arr2.
\tclass Solution {\n\tpublic:\n\t\tvector<int> addNegabinary(vector<int>& arr1, vector<int>& arr2) {\n\t\t\treverse(arr1.begin(),arr1.end());\n\t\t\treverse(arr2.begin(),arr2.end());\n\t\t\tint len(max(arr1.size(),arr2.size()));\n\t\t\tint carry=0;\n\t\t\tvector<int> ans;\n\t\t\tfor(int i=0;i<len+2;i++){\n\t\t\t\tint cur1=i<arr1.size() ? arr1[i]:0;\n\t\t\t\tint cur2=i<arr2.size() ? arr2[i]:0;\n\t\t\t\tint sum=cur1+cur2+carry;\n\t\t\t\tint r=sum%(-2);\n\t\t\t\tcarry=sum/(-2);\n\t\t\t\tif(r<0){\n\t\t\t\t\tcarry++;\n\t\t\t\t\tr+=abs(-2);\n\t\t\t\t}          \n\t\t\t\tans.push_back(r);\n\n\t\t\t}\n\t\t\twhile(ans.size()>1 && ans.back()==0){\n\t\t\t\tans.pop_back();\n\t\t\t}\n\t\t\treverse(ans.begin(),ans.end());\n\t\t\treturn ans;\n\t\t}\n\t};
['C', 'C++']