So I have 4 list, I want to find out which list.size(); is the lowest. I can find the lowest but some turn out to be the same, this is what I have.
Here's how I'd approach your requirements:
Define a Multimap which would store list.size
values and map it to the Set
of labels (or lists, depeding what you're interested in - not 100% clear from the question). So in your case multimap will store the following:
2 -> Set("Diamond", "Emerald")
3 -> Set("Gold")
4 -> Set("Iron")
Find lowest value of all multimap keys.
Get the set of labels for the lowest value.
Choose one of the labels at random.