C# Solution Run time beat 100%
Intuition\nIn such case, we observe\n1 + 1 = 110\n11 + 01 = 00\n\nAlso we can prove that any bits with a carryforward value will never greater than 3(sum <= 3 h
# Intuition\nIn such case, we observe\n1 + 1 = 110\n11 + 01 = 00\n\nAlso we can prove that any bits with a carryforward value will never greater than 3(sum <= 3 holds true)\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(k), k = Max(m, n);\n- k is the maximum length of two arrays\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(k)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\npublic class Solution {\n    public int[] AddNegabinary(int[] arr1, int[] arr2) {\n        int carrfor = 0;\n        int n1 = arr1.Length, n2 = arr2.Length;\n        int n = Math.Max(n1, n2);\n\n        int[] ans = new int[n+2];\n        int i = n1-1;\n        int j = n2-1;\n        int k = n-1+2;\n        int e1,e2;\n        while(i>=0 || j>=0){\n            e1 = i >= 0 ? arr1[i] : 0;\n            e2 = j >= 0 ? arr2[j] : 0;\n\n            var tot = ans[k] + e1 + e2;\n            if(tot > 1){\n                tot -= 2;\n                if(i-1>=0 && arr1[i-1]==1){\n                    arr1[i-1] = 0;\n                }\n                else if(j-1>=0 && arr2[j-1]==1){\n                    arr2[j-1] = 0;\n                }\n                else if(ans[k-1]>0){\n                    ans[k-1]--;\n                }\n                else{\n                    ans[k-1] = 1;\n                    ans[k-2] = 1;\n                }\n            }\n            ans[k] = tot;\n\n            i--;\n            j--;\n            k--;\n        }\n\n        int idx = 0;\n        while(idx<n+2 && ans[idx]==0){\n            idx++;\n        }\n        if(idx == n+2){\n            return new int[]{0};\n        }\n\n        int[] res = new int[n+2-idx];\n        Array.Copy(ans, idx, res, 0, n+2-idx);\n\n        return res;\n    }\n}\n```
['C#']