Given two arrays of equal length A and B. you can apply the following operation on A any number of times:

Choose two index i and j with i=/=j and change A[i] = A[i] - 2 and A[j] = A[j] + 2. 

Find the minimum number of such operations to be applied on A such that the array A becomes equal to array B. 

Note: The order of elements in arrays do not matter i. e. if A = [7, 11] and B = [11, 7] then they are considered equal.
Comments (4)