We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
index.ts
export function hasDuplicate(numbers: number[]): boolean { const uniqueNumbers: Set<number> = new Set(); for (const num of numbers) { if (uniqueNumbers.has(num)) { return true; // Duplicate found } uniqueNumbers.add(num); } return false; // No duplicates found }