Duplicates in more than two sets
I have a map which is declared to hold String and TreeSet integer.
like so :
Name : 10 , 20 , 40
Name2 : 12 , 33, 50
Name3: 14, 50, 20
I want to ensure that each name has unique set of integers no duplicates allowed even if the duplicate number is in another name's set..
for two sets I can compare directly and remove duplicates but what is the best way to ensure that there is no duplicates while there are more than two sets ??
Thank you in advance