Given an array where every number appears twice except two numbers that appear once, find the two unique numbers.
Unlock detailed company stats for this questionUpgrade
Example: [1, 2, 3, 2, 1, 5] -> 3 and 5. Optimal: XOR approach, O(n) time, O(1) space.
Community answers
No answers contributed by the community yet.
Related questions
Given an array of numbers where every number occurs twice except one, how would you find the unique number in O(log n) time?Every value in an integer array appears exactly twice except one value that appears once. Find that value.Given an array where the cost of adding two numbers is their sum, find the minimum cost of adding all the numbers.Related courses

Course

Course
Course
