Contains Duplicate

L2 Easy Arrays & Hashing
Concept
A Set turns "have I seen this value already?" from a scan into an instant check, which changes the whole shape of this problem.
Given an array of integers nums, report whether any number shows up more than once. Return true when a repeat exists, and false when every value is distinct.
Examples
▸ nums = [1, 5, 9, 5]
→ true
▸ nums = [2, 4, 6, 8]
→ false
▸ nums = []
→ false
Progressive Hints
Hint 1 · Nudge
Instead of rechecking everything you've already passed, keep a memory of it.
Hint 2 · Plan
Walk the array keeping every value you've seen in a set. The moment you meet a value already in the set, return true. If you finish without a repeat, return false.
Hint 3 · Approach
seen = empty set. For each n: if n is already in seen return true, otherwise add n to seen. Return false.
Output
// Run your code to see the output here.