Given a non-empty array of integers nums where every element appears exactly twice except for one element which appears exactly once, find and return that single element.
You must solve this using XOR bit manipulation with O(n) time and O(1) extra space.
nums = [2, 2, 1]1nums = [4, 1, 2, 1, 2]4nums = [1]11 <= nums.length <= 10^4nums.length is odd-10^4 <= nums[i] <= 10^4Every element appears exactly twice except one which appears onceRun your code to see results
Use Cmd+Enter to run