There are 10 boxes of donuts sitting on a table. There are 10 donuts in each box. There are 30 flavors of donuts distributed randomly across the boxes.
I need to eat one of each flavor of donut. And I need to eat donuts from the minimum number of boxes.
How can I optimize this? Also, I know beforehand which donuts are in each box.
You need to eat from at least three boxes ($3\times10=30$ donuts), and may need to eat from all ten depending on how the 30 flavors are distributed and there are 967 such possible distributions.
This is not a large number so it should be sufficient to test as follows:
If you want an approximate solution but need it very fast, then a greedy algorithm may get you a quicker result but will sometimes overestimate the number of boxes needed. But if the donuts are randomly distributed this won't be a problem often: