You are given two numbers represented in negabinary (base −2). Each number is provided as an array of 0s and 1s, ordered from the most significant bit to the least significant bit. For instance, arr = [1,1,0,1] corresponds to the value (−2)3+(−2)2+(−2)0=−3.
Each input array is guaranteed to contain no leading zeros: either the array is [0], or the first element is 1.
Given two such arrays arr1 and arr2, compute their sum and return the result in the same negabinary array format, with no leading zeros.
Constraints: