S
All challenges
Practice
Home
Blog
Practice
Examples
Feedback
Remove Nth Node From End
00:00
Start
00:00
Sign in
Problem
Hints
3
Solution
History
Medium
Linked List
Two Pointers
Fast & Slow
Amazon
Microsoft
Remove the nth node from the end of a linked list. Return the head of the modified list.
Examples
Example 1
Input →
1
Output →
2→3→4→5, n=2 → 1→2→3→5
Example 2
Input →
[1], n=1
Output →
[]
Example 3
Input →
1
Output →
2, n=1 → [1]
JavaScript
Python
Java (Coming soon)
C (Coming soon)
C++ (Coming soon)
Reset
Run
Submit
Cases
Results