Contains Duplicate
Given an array of integers nums, return true if some value appears at least twice, and false if every value is different.
Constraints
- 1 ≤ length of
nums≤ 10,000 - -1,000,000,000 ≤
nums[i]≤ 1,000,000,000
Example 1
Input
nums = [1,2,3,1]
Output
true
Why:
1 is at positions 0 and 3.
Example 2
Input
nums = [1,2,3,4]
Output
false
Why:
Every value is different.
Hints
Was this a good challenge?
- Solved by
- 0
- Submissions
- 0
- Accepted
- –