Skip to content

Files

Latest commit

bb4aed6 · Jun 3, 2023

History

History
23 lines (17 loc) · 708 Bytes

File metadata and controls

23 lines (17 loc) · 708 Bytes

🚨 Problem

Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

Example 1:

Input: nums = [1,2,3,1]
Output: true

Constraints:

  • 1 <= n u m s . l e n g t h <= 10 5
  • 10 9 <= n u m s [ i ] <= 10 9

🔐 Solutions

ID METHOD
1 Hash Set