I need a collection that is like a set. Basically I'm scanning a long string and adding words to the collection but I want to be able to detect when there are duplicates.
If sets aren't available, what's the most efficient way of doing this in Ruby? Brownie points for example code.