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
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console