Given an array of positive integers, each of which represent the number of litres of water in that particular bucket, we have to make the litres of water in every bucket equal.
We are allowed to do two types of operations any number of times:
We have to tell what is the minimum number of litres removed to make all buckets have the same amount of water.
Eg.
Input:
1 2 3
Output:
2
Explanation:
We remove bucket 1 and remove 1 liter from Bucket 3, so total water removed is 2 liter (the amount of water in the bucket removed gets added to the total water removed).