Contains Duplicate

Easy
Arrays Array Hash Table Sorting

Given an integer array, return true if any value appears at least twice.

Constraints

1 ≤ nums.length ≤ 10^5

Examples

Example 1:
Input: 1 2 3 1
Output: true
Example 2:
Input: 1 2 3 4
Output: false
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.