Solution Adding Two Negabinary Numbers
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    /**\n     * @param Integer[] $arr1\n     * @param Integer[] $arr2\n     * @return Integer[]\n     */\n    function addNegabinary($arr1, $arr2) {\n        $result = [];\n        $carry = 0;\n        $i = count($arr1) - 1;\n        $j = count($arr2) - 1;\n        \n        while ($i >= 0 || $j >= 0 || $carry != 0) {\n            if ($i >= 0) {\n                $carry += $arr1[$i--];\n            }\n            if ($j >= 0) {\n                $carry += $arr2[$j--];\n            }\n            array_unshift($result, $carry & 1);\n            $carry = -(int)($carry >> 1);\n        }\n        \n        // Remove leading zeros\n        $index = 0;\n        while ($index < count($result) - 1 && $result[$index] == 0) {\n            $index++;\n        }\n        \n        return array_slice($result, $index);\n    }\n}\n\n```
['PHP']