I'm currently using a Multiset to hold a maximum of three numbers. I need to check if:
- A number appears more than once
- A number and another number appear the same amount of times
- There is only one number
- The list is empty
Below is my current code. In this case, team is a Multimap and points is the Multiset:
for(int a = 0; a <= team.keySet().size(); a++)
{
if(points.count(a) > 1)
{
// Point 1
}
else if(points.size == 1)
{
// Point 3
}
else if(points.isEmpty()
{
// Point 4
}
}
I'm stuck as to how I would implement Point 2 - any suggestions?