you are given two arrays having n elements ,
like for n=4,suppose
array1={1,2,3,4}
array2={2,1,4,5}
convert array 1 to array2 performing operation minimum number of time . Also state if transformation is not possible.I want a general condition for any two given arrays.
OPERATION- chose a ith element and decrement it by one and increment a all other elements by 1.
Hint: what happens to the sum of the elements under your operation? What does that tell you about whether this is possible?