
Leetcode Problem 136: Single Number
Given a non-empty array of integers where every element appears exactly twice except for one element that appears only once, find and return that single element.
Your solution must use linear time and constant extra space.
Constraints:
const singleNumber = (nums: number[]) => nums.reduce((accumulator, current) => accumulator ^ current)