Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Contains Duplicate

XPChallenge Points: 10
levelLevel: Easy

You are given an integer array nums.
Your task is to determine whether any value appears more than once in the array.

If any element occurs at least twice, return true.
If every element is distinct, return false.

Example 1:

Input: nums = [5, 8, 12, 5]

Output: true

Example 2:

Input: nums = [10, 20, 30, 40]

Output: false

Example 3:

Input: nums = [7, 7, 9, 11, 9, 13, 14]

Output: true

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result