Arrays & HashingEasy
Contains Duplicate
Return true if any number appears at least twice in nums, and false if every number is different.
Example 1nums = [4, 1, 7, 4] → true4 appears twice.
Example 2nums = [5, 6, 7] → false
1 ≤ n ≤ 10⁵ · −10⁹ ≤ nums[i] ≤ 10⁹