Contains Duplicate

Easy
ArrayHash TableSortingAmazonApple
Given an integer array, print whether any value appears at least twice. Input format: - First line: n - Second line: n integers Print `true` if a duplicate exists, otherwise print `false`.

Constraints

1 <= n <= 10^5
-10^9 <= nums[i] <= 10^9

Sample tests

Sample 1

Sample 2

Sign in to submit