#K83972. Find the Duplicate Number

    ID: 36316 Type: Default 1000ms 256MiB

Find the Duplicate Number

Find the Duplicate Number

You are given an array of integers containing exactly one duplicate element; every other element appears exactly once. Your task is to find and output the duplicate number.

The input format is as follows:

  • The first line contains a single integer \( n \): the number of elements in the array.
  • The second line contains \( n \) space-separated integers.

You can assume that there is exactly one element that appears twice, and all other elements appear only once.

Example:

Input:
6
1 3 4 2 2 5

Output: 2

</p>

inputFormat

The first line contains an integer \( n \) (the number of elements in the array). The second line contains \( n \) space-separated integers representing the array elements.

outputFormat

Output the duplicate integer found in the array.

## sample
6
1 3 4 2 2 5
2