We are given an array and the task is to make all elements equal by doing the following operations. Cost of each operation is one.
Return the minimum cost of performing the task.
Operations
I don't have the constraints, but if you have an idea of how to solve it please share the optimized solution that you can think of