Login

All Problems

Problem title

Difficulty

Avg time to solve

LCA of three Nodes

Easy

20 mins

Sum Of Infinite Array

Moderate

35 mins

Pair Sum

Easy

15 mins

Sum or Product

Easy

15 mins

Reverse The Array

Easy

15 mins

Yogesh And Primes

Moderate

20 mins

Find Duplicate in Array

Easy

15 mins

Beautiful String

Easy

18 mins

Longest Univalue Path

Moderate

10 mins

Sort 0 1 2

Easy

22 mins

Problem

Submissions

248

Avg. time to solve

15 min

Success Rate

85%

Problem Statement

```
All the integers in the array appear only once except for precisely one integer which appears two or more times.
```

```
The first line of input contains an integer ‘T’ denoting the number of test cases. Then the T test cases follow.
The first line of each test case contains an integer ‘N’, the number of elements in the array.
The second line of each test case contains ‘N’ space-separated integers representing the elements of the array.
```

```
For each test case, the duplicate element of the given array is printed.
The output of each test case is printed in a separate line.
```

```
You are not supposed to print anything; It has already been taken care of. Just implement the given function.
```

```
1 <= T <= 5
1 <= N <= 10^5
1 <= ARR[i] <= N - 1
Time Limit: 1 sec
```

```
1
3
1 1 2
```

```
1
```

```
1 is repeated in the array, hence function returns 1.
```

```
3
5
1 3 4 2 2
5
3 1 3 4 2
3
1 1 1
```

```
2
3
1
```

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Language

Change Theme

Solution submission not allowed

Save Code

Reset Code