Challenge: Return the Nth Node from End

Try to solve the Return the Nth Node from End problem.

We'll cover the following


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


  • The number of nodes in the list is kk.

  • 11 \leq kk 103 \leq 10^3

  • 103-10^3\le 103\leq 10^3

  • 11\len \lekk


Level up your interview prep. Join Educative to access 80+ hands-on prep courses.