Contains Duplicate
Easy
LC #217
hash setarrayNot attempted yet
Given an integer list nums, return True if some value
appears at least twice, and False if every value is
distinct.
Example 1
Input: nums = [1, 2, 3, 1]
Output: True
Example 2
Input: nums = [1, 2, 3, 4]
Output: False
Example 3
Input: nums = [4, 1, 4, 4, 2, 1]
Output: True
Constraints
- 1 ≤ len(nums) ≤ 2 · 10^5
- -10^9 ≤ nums[i] ≤ 10^9