Best Java Solution || Beats 80%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n\n    // taken help\n    \n    public int[] addNegabinary(int[] arr1, int[] arr2) {\n        List<Integer> list = new ArrayList<>();\n        int n = arr1.length;\n        int m = arr2.length;\n        int carry = 0;\n        int i = n - 1, j = m - 1;\n        while(i >= 0 && j >= 0) {\n            int val = arr1[i] + arr2[j] + carry; // calculate current value\n            int digit = 0;\n            if (val < 0) {\n\n                carry = 1;\n                digit = 1;\n            } \n            else {\n                carry = -(val / 2);\n                digit = val % 2;\n            }\n            list.add(0, digit);\n            --i;\n            --j;\n        }\n        while(i >= 0) {\n            int val = arr1[i] + carry;\n            int digit = 0;\n            if (val < 0) {\n                carry = 1;\n                digit = 1;\n            } \n            else {\n                carry = -(val / 2);\n                digit = val % 2;\n            }\n            list.add(0, digit);\n            --i;\n        }\n        while(j >= 0) {\n            int val = arr2[j] + carry;\n            int digit = 0;\n            if (val < 0) {\n                carry = 1;\n                digit = 1;\n            } \n            else {\n                carry = -(val / 2);\n                digit = val % 2;\n            }\n            list.add(0, digit);\n            --j;\n        }\n        if (carry != 0) {\n            if (carry == -1) {\n                list.add(0, 1);\n                list.add(0, 1);\n            }\n            else {\n                //carry == 1\n                list.add(0, carry);\n            }\n        }\n        // remove leading zeros\n        while(list.size() > 1 && list.get(0) == 0) {\n            list.remove(0);\n        }\n        int[] ans = new int[list.size()];\n        for (int k = 0; k < list.size(); ++k) {\n            ans[k] = list.get(k);\n        }\n        return ans;\n    }\n}\n```
['Java']