Contains Duplicate

Given an array of integers nums, return true if any value appears at least twice.

Input Format

nums = array of integers

Output Format

true if a duplicate exists, false otherwise

Constraints

  • 0 <= nums.length <= 10^5; -10^9 <= nums[i] <= 10^9

Examples

Example 1:

Input:

nums = [1,2,3,1]

Output:

true

Explanation:

The value 1 appears twice.

Loading...
Contains Duplicate - Arrays DSA Problem