Back to DSA

Single Number

easy
Acceptance: 67%
Bit ManipulationArrays

In an array of integers, every value occurs exactly twice except for one value that appears only once. Identify that unique value. Your solution should run in linear time and use no extra memory.

Examples

Example 1:
Input:nums = [5,3,5]
Output:3
Example 2:
Input:nums = [7,1,3,1,3]
Output:7

Hints

00:00
1234567