There were given 2 arrays of size n and m. We have to find the minimum number of swaps to make sum of array1 even and array2 even. If not possible return -1 and if their respective sums are even return 0.
Test case 1 :
array1 = {3,3,6,2} sum1 = 14(even)
array2 = {4,1,6,3} sum2 = 14(even)
As both sum1 and sum2 are even the output is 0, as indicating no swaps.
Test case 2:
array1 = {1,4, 20, 2}
array2 = {5, 9, 6, 3}
output is 1, as indicating no swaps.