Ruby Set

Ruby Set - a list of unique items.
Two special attributes:

  • Fast lookup times (with include?)
  • Unique values

Benchmark #include?

# Ruby 2.5.0
set   include: 8381985.2 i/s
array include: 703305.5  i/s - 11.92x  slower

Credit to rubyguides