Not able to understand the question

can u please explain it

hi @Aditikumari, the problem statement given to us is :-

Given an array A of size n, In a single operation you can subtract one from A[i] and add it to either A[i-1] (if i>0) or A[i+1] (if i < n-1).
Find the minimum number of operation required to make all the array elements same.
If it is not possible to do , print -1.

In one operation what we can do is select any i (<N) and subtract 1 from A[i] and add it to either A[i+1] or A[i-1]. so doing these operation we have to make each elements of the array same i.e A[i] = A[j] for any i and any j. our task is to find minimum of such operation .
Note : the sum of array remains the same after every operation

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.