Close
Topic list
Duplicate In Array
EASY
15 mins
Arrays
Topics (Covered in this problem)
Problem solved
Skill meter
Arrays
-
-
Other topics
Problem solved
Skill meter
Strings
-
-
Matrices (2D Arrays)
-
-
-
-
Sorting
-
-
Binary Search
-
-
Stacks & Queues
-
-
Trees
-
-
Graph
-
-
Dynamic Programming
-
-
Greedy
-
-
Tries
-
-
SQL
-
-
Binary Search Trees
-
-
Heap
-
-
Bit Manipulation
-
-
Solve problems & track your progress
Checkout your overall progress in every topic here
Become
Sensei
in DSA topics
Open the topic and solve more problems associated with it to improve your skills
Check out the skill meter for every topic
See how many problems you are left with to solve for cracking any stage. Score more than zero to get your progress counted.

# Duplicate In Array

Contributed by
Prateek_18cb
Easy
0/40
Avg time to solve 15 mins
Success Rate 85 %
Share

## Problem Statement

#### For example:

``````Consider ARR = [1, 2, 3, 4, 4], the duplicate integer value present in the array is 4. Hence, the answer is 4 in this case.
``````
##### Note :
``````A duplicate number is always present in the given array.
``````
Detailed explanation ( Input/output format, Notes, Constraints, Images )
##### Sample Input 1:
``````2
5
4 2 1 3 1
7
6 3 1 5 4 3 2
``````
##### Sample Output 1:
``````1
3
``````
##### Explanation of sample input 1:
``````For the first test case,
The duplicate integer value present in the array is 1. Hence, the answer is 1 in this case.

For the second test case,
The duplicate integer value present in the array is 3. Hence, the answer is 3 in this case.
``````
##### Sample Input 2:
``````2
6
5 1 2 3 4 2
9
8 7 2 5 4 7 1 3 6
``````
##### Sample Output 2:
``````2
7
``````
Auto
Console