This is the simplest hash set problem and a great warm-up for understanding how sets provide O(1) lookup to detect duplicates.
Enable JavaScript for the full StreamPrep guide.