【leetcode每日一题】NO19.Remove Nth Node From End of List
题目:Given a linked list, remove the nth node from the end of list and return its head.即给定一个链表,删除倒数第n个节点。解析:可以声明两个指针,让指针A先指向第n个节点,指针B指向第1个节点,两个指针同时遍历链表,当指针A指向最后一个节点时,指针B真好指向倒数第n个节点。注意:要判断n和链表长度的关系。代码:/*