@SimonForsberg Hmm. So keep putting stuff in a Set and keep track of the size of it? So when you add in an element and the size remains the same then you have your duplicate?
@bruglesco I have a feeling that the Set implementation probably already does this existence check when attempting to add a value, so it may not be that much more efficient
@bruglesco Depends on the implementation. Also, depending on the language the add method itself might return a specific value if the value existed already. I know Java does this.