Example 1
Input
nums = [1, 2, 3, 1]
Output
true
Loading CodeSprint...
/problems/contains-duplicate
Return true when an integer appears more than once in the list. Return false when every value is unique.
Implement this function and return the result. CodeSprint supplies each test case automatically.
containsDuplicate(nums) → booleanInput
nums = [1, 2, 3, 1]
Output
true
Input
nums = [1, 2, 3, 4]
Output
false
Constraints
0 <= nums.length <= 100,000 -1,000,000,000 <= nums[i] <= 1,000,000,000