

‘ARR1’ = [1, 0, 1, 1], it represents (-2) ^ 3 + (-2) ^ 1 + (-2) ^ 0 = -9.
‘ARR2’ = [1, 0, 1] it represents (-2) ^ 2 + (-2) ^ 0 = 5.
‘RESULT’ = [1, 1, 0, 0], it represents (-2) ^ 3 + (-2) ^ 2 = -4.
As, -9 + 5 = -4.
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case contains two space-separated integers ‘N‘ and ‘M’, the number of bits in ‘ARR1’ and ‘ARR2’.
The second line of each test case contains ‘N’ space-separated bits, representing ‘ARR1’.
The third line of each test case contains ‘M’ space-separated bits, representing ‘ARR2’.
For each test case, print the addition of two numbers in base -2 representation.
Output for every test case will be printed in a separate line.
You don’t need to print anything; It has already been taken care of. Just implement the given function.
1 <= T <= 50
1 <= N, M <= 10^6
Where ‘T’ is the number of test cases, 'N' is the length of ‘ARR1’ and 'M' is the length of ‘ARR2’.
Time Limit: 1 sec.
Approach: We can add two base -2 numbers the same way as we add two base 10 numbers. We will go from least significant bit to most significant bit and maintain a carry.