Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Single Number III
Bookmark
Input
Example 1
Example 2
Example 3
Custom
nums
=
[1, 2, 1, 3, 2, 5]
0
1
2
3
4
5
1
2
1
3
2
5
algo
master
.
io
Step:
Two numbers appear once, everything else twice. XOR everything, then split the numbers by a bit where the two answers differ
0 / 29
Input
Example 1
Example 2
Example 3
Custom
nums
=
[1, 2, 1, 3, 2, 5]
0 / 29
0
1
2
3
4
5
1
2
1
3
2
5
algo
master
.
io
Step:
Two numbers appear once, everything else twice. XOR everything, then split the numbers by a bit where the two answers differ