Search⌘ K
AI Features

Problem: Contains Duplicate

Explore how to determine if any value appears more than once in an integer array by implementing a hash set to track seen elements. Understand how to efficiently check duplicates with O(n) runtime and manage space for storing unique items.

Statement

Given an integer array nums, determine whether any value appears more than once in the array. Return TRUE if a duplicate exists, and FALSE if all elements are unique.

Constraints:

  • 11 \leq nums.length 105\leq 10^5 ...