leetcode 19:删除链表的倒数第N个节点

ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode*l1=head; int c=0; while(l1!=NULL) { c+=1; l1=l1->next; } if(c==n)return head->next; if(c<n)retu
相关文章
相关标签/搜索