Contains Value

L1 Easy Arrays & Hashing
Concept
A Set stores distinct values and answers "have I seen this before?" in nearly constant time.
Return true if value appears anywhere in nums, and false otherwise.
Examples
▸ nums = [1, 2, 3], value = 2
→ true
▸ nums = [1, 2, 3], value = 4
→ false
▸ nums = [], value = 1
→ false
Progressive Hints
Hint 1 · Nudge
Can you remember what you've already seen without rechecking everything?
Hint 2 · Plan
Drop every number into a set, which keeps no duplicates. Then just ask the set whether value is inside and return that answer.
Hint 3 · Approach
seen = a set of every number in the array. Return whether value is in seen.
Output
// Run your code to see the output here.