BackmediumHashing PhonePe

Detect Duplicate Values Solution

Problem Statement

You are given an array of integers `values`, determine if there are any duplicate values in the collection. Implement a function to identify and report the presence of duplicate entries.

Example 1
Input
[1, 2, 3, 4, 5]
Output
false

Explanation: No duplicate values are present in the array.

Example 2
Input
[1, 2, 2, 4, 5]
Output
true

Explanation: The value 2 is duplicated in the array.

Constraints

  • 1 <= values.length <= 10^5
  • -10^9 <= values[i] <= 10^9
  • values contains only integers
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free