it can be done by making all elements equal in all sides
Answers
Answered by
0
Explanation:
Sort the array of Integers in increasing order.
Now, to make all elements equal with min cost. ...
If A[i] < K, Increment the element by K – A[i].
If A[i] > K, Decrement the element by A[i] – K.
Update cost of each operation performed.
Similar questions
Math,
10 days ago
India Languages,
10 days ago
Science,
10 days ago
History,
21 days ago
Computer Science,
21 days ago
Math,
9 months ago
Math,
9 months ago