Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Consider we replace all the 0’s with 1’s on both arrays, the answer will be <code>-1</code> if there was no <code>0</code> in the array with the smaller sum of elements.
Otherwise, how can you update the value of exactly one of these <code>1</code>’s to make the sum of the two arrays equal?