#K2416. Find the Unique Element

    ID: 24732 Type: Default 1000ms 256MiB

Find the Unique Element

Find the Unique Element

You are given an array of integers of length n where all elements appear exactly three times except for one unique element that appears only once. Your task is to find and output that unique element.

Hint: A solution with a linear time complexity and constant space usage can be achieved using bit manipulation. Consider how individual bits contribute when summing bit occurrences for numbers that repeat.

inputFormat

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.

outputFormat

Output a single integer, the element that appears only once.

## sample
4
2 2 3 2
3