...

/

Remove Nth Node from End of List

Remove Nth Node from End of List

Try to solve the Remove Nth Node from End of List problem.

Statement

Given the head of a singly linked list, remove the nthn^{th} node from the end of the list and return its head.

Constraints:

  • The number of nodes in the list is k.
  • 11\le k 103\le 10^3
  • 103-10^3\le Node.data 103\le 10^3
  • 11\le n \le k

Examples

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy