Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Remove Nth Node From End of List
Bookmark
Two Pass
One Pass
Input
Remove 2nd from end
Remove first
Remove last
Custom
values
=
[1, 2, 3, 4, 5]
,
n
=
2
1
2
3
4
5
head
1
2
3
4
5
head
1
2
3
4
5
head
curr
1
2
3
4
5
head
curr
1
2
3
4
5
head
curr
1
2
3
4
5
0
dummy
head
1
2
3
4
5
0
dummy
head
prev
1
2
3
4
5
0
dummy
head
prev
1
2
3
4
5
0
dummy
head
prev
1
2
3
4
5
0
dummy
head
prev
1
2
3
5
0
dummy
algo
master
.
io
Step:
Start: remove the 2nd node from the end
0 / 15
Input
Remove 2nd from end
Remove first
Remove last
Custom
values
=
[1, 2, 3, 4, 5]
,
n
=
2
0 / 15
algo
master
.
io
Step:
Start: remove the 2nd node from the end