Two Single Numbers
Try to solve the Two Single Numbers problem.
We'll cover the following
Statement
Given a non-empty array arr
, in which exactly two elements appear once, and all the other elements appear twice, return the two elements that appeared only once.
Note: The result can be returned in any order. The solution should use only constant extra space.
Constraints:
arr.length
arr[i]
Examples
Create a free account to view this lesson.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy