← 返回 atlassian 的题目列表Identify Unique Element in Array
类型:online_judge
Given an integer array where only one element appears once and all others appear three times, find the unique element and return it. Complete this task without using extra space.
Input Format:
The first line contains an integer n, denoting the size of the array (1 <= n <= 10^4).
The second line contains n integers representing the elements of the array.
Output Format:
Output the unique element.
Test Cases:
Input: 7 2 2 3 2 4 4 4
Output: 3
Example
Input
7
2 2 3 2 4 4 4