Removing Minimum Number of Magic Beans
You are given an array representing bags of magic beans. Each element in the array represents the number of beans in a bag. Your goal is to remove the minimum number of beans to make the remaining non-empty bags have an equal number of beans. Write a function that calculates and returns the minimum number of beans to be removed.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)