Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Set Mismatch
Bookmark
Input
Example 1
Example 2
Example 3
Custom
nums
=
[1, 2, 2, 4]
0
1
2
3
1
2
2
4
duplicate = ?
missing = ?
0
1
2
3
1
2
2
4
duplicate = ?
missing = ?
0
1
2
3
-1
2
2
4
i
target
duplicate = ?
missing = ?
0
1
2
3
-1
2
2
4
i
target
duplicate = ?
missing = ?
0
1
2
3
-1
-2
2
4
i
target
duplicate = ?
missing = ?
0
1
2
3
-1
-2
2
4
i
target
duplicate = 2
missing = ?
0
1
2
3
-1
-2
2
-4
i
target
duplicate = 2
missing = ?
0
1
2
3
-1
-2
2
-4
i
duplicate = 2
missing = ?
0
1
2
3
-1
-2
2
-4
i
duplicate = 2
missing = ?
0
1
2
3
-1
-2
2
-4
i
duplicate = 2
missing = 3
0
1
2
3
-1
-2
2
-4
duplicate = 2
missing = 3
algo
master
.
io
Step:
nums holds 1..4 with one number duplicated and one missing. Pass 1 marks value v as seen by negating nums[v-1]
0 / 15
Input
Example 1
Example 2
Example 3
Custom
nums
=
[1, 2, 2, 4]
0 / 15
algo
master
.
io
Step:
nums holds 1..4 with one number duplicated and one missing. Pass 1 marks value v as seen by negating nums[v-1]