Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
nums
true
false
nums = [1,2,3,1]
nums = [1,2,3,4]
1 <= nums.length <= 10^5 -10^9 <= nums[i] <= 10^9
Topics
Implement containsDuplicate in the editor and return the answer — printing it is never graded.
containsDuplicate
Problem 5 of 1146 in the arena