Find Unique Element

Given an array where every element appears twice except for one, find the single element that appears only once. Your algorithm must run in linear time and use constant extra space.

Examples
Input: [2,2,1]
Output: 1
Hints

Find Unique Element

Given an array where every element appears twice except for one, find the single element that appears only once. Your algorithm must run in linear time and use constant extra space.