Find the unique element

You are given an array of non-negative integers where each element occurs exactly twice except one which occurs once.

Find the element occurring once.

Examples:

Input 1:

[1, 1, 2, 2, 3]

Output 1:

3

Explanation 1:

There are two 1s and two 2s whereas only one 3.

Follow Up: Can you do it using constant space and linear time ?

Contributed by Ali Ahmet Bingül