Find Duplicates in Array

Languages

Given an array of integers numbers, determine whether the array contains any duplicate values. A duplicate is defined as any number that appears more than once in the array.

Input

  • numbers: number[]: An array of integers

Examples

Input: numbers = [5,7,1,3]
Output: false
Explanation: All elements in the array are unique.
Input: numbers = [10,7,0,0,9]
Output: true
Explanation: 0 appears more than once.
Input: numbers = [3,2,6,5,0,3,10,3,10,5]
Output: true
Explanation: 3,5, and 10 appears more than once.

Constraints

  • 1 <= numbers.length <= 10,000
  • -1,000,000 <= numbers[i] <= 1,000,000
The "undefined is not a function" Tee — A debugging classicSponsor: SwagOverflow
The "undefined is not a function" Tee — A debugging classic

A front end rite of passage — staring at this error in despair. Now, wear it with pride. This crisp white tee features the infamous JavaScript headache in bold, minimalist typography, making it the perfect uniform for late-night debugging sessions. A must-have for any front end engineer who’s been personally victimized by undefined.

Get yours now ->

The "undefined is not a function" Tee — A debugging classicSponsor: SwagOverflow
The "undefined is not a function" Tee — A debugging classic

A front end rite of passage — staring at this error in despair. Now, wear it with pride. This crisp white tee features the infamous JavaScript headache in bold, minimalist typography, making it the perfect uniform for late-night debugging sessions. A must-have for any front end engineer who’s been personally victimized by undefined.

Get yours now ->