Given a linked list, remove the nth node fromtheendoflistandreturnits head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing thesecond node fromtheend, the linked list becomes 1->2->3->5.
Note:
Given n will always be valid.
Try to do this in one pass.
LeetCode 19 Remove Nth Node From End of List(从列表尾部删除第N个结点)(*)
翻译给定一个链表,移除从尾部起的第n个结点,并且返回它的头结点。例如,给定链表:1->2->3->4->5,n = 2。在移除尾部起第二个结点后,链表将变成:1->2->3->5。备注:给定的n是有效的,代码尽量一次通过。原文Given a linked list, remove the nth node from the end of list and return its head.For ex