19. Remove Nth Node From End of List
Practice Remove Nth Node From End of List for free on NudgeCode: Medium, Linked List pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Delete the n-th node counting from the end of a linked list (the last node is n = 1) and return the head of the resulting list.
Example
head = [1,2,3,4,5], n = 2 -> [1,2,3,5]
Constraints
- 1 <= length of the list <= 30
- 0 <= Node.val <= 100
- 1 <= n <= length of the list