Problem 2171 · Medium

Removing Minimum Number of Magic Beans

Remove the fewest beans so that every remaining nonempty bag ends with the same count. The visual sorts the bags and shows the cost of trimming all bags down to each candidate level.

Open the interactive visualisation