#K44202. Find Unique Element

    ID: 27479 Type: Default 1000ms 256MiB

Find Unique Element

Find Unique Element

Problem Statement:

You are given an array of integers where every element appears exactly twice except for one unique element that appears only once. Your task is to identify and print this unique element.

The solution should have a time complexity of (O(n)) and use constant auxiliary space (O(1)). You can achieve this by employing the properties of the XOR operation, since for any integer (a), (a \oplus a = 0) and (0 \oplus a = a).

inputFormat

Input:

The first line of input contains an integer (n) representing the number of elements in the array. The second line contains (n) space-separated integers. It is guaranteed that (n) is odd and exactly one element appears only once while all the other elements appear twice.

outputFormat

Output:

Print the unique element that appears only once in the array.## sample

1
1
1

</p>