Merge pull request #2350 from QZ-z/master

Update 0019.删除链表的倒数第N个节点.md
This commit is contained in:
程序员Carl
2023-12-01 09:48:28 +08:00
committed by GitHub

View File

@ -106,7 +106,7 @@ public ListNode removeNthFromEnd(ListNode head, int n){
ListNode slowIndex = dummyNode;
// 只要快慢指针相差 n 个结点即可
for (int i = 0; i <= n ; i++){
for (int i = 0; i < n ; i++){
fastIndex = fastIndex.next;
}