First Repeated Value

L2 Easy Arrays & Hashing
Concept
Returning the *first* repeat needs an ordering trick: as soon as a value is seen twice, that is your answer.
Return the first value in nums that appears more than once. If every value is unique, return nil.
Examples
▸ nums = [2, 1, 3, 2]
→ 2
▸ nums = [1, 2, 3]
→ nil
▸ nums = []
→ nil
Progressive Hints
Hint 1 · Nudge
The first repeat is the one you bump into before any other repeat.
Hint 2 · Plan
Scan left to right, adding each value to a set. As soon as the current value is already in the set, return it. If the scan finishes cleanly, return nil.
Hint 3 · Approach
seen = empty set. For each n: if n is in seen return n, otherwise add n. Return nil.
Output
// Run your code to see the output here.