diff --git a/problems/0019.删除链表的倒数第N个节点.md b/problems/0019.删除链表的倒数第N个节点.md index dbd053d1..28bb61ee 100644 --- a/problems/0019.删除链表的倒数第N个节点.md +++ b/problems/0019.删除链表的倒数第N个节点.md @@ -110,7 +110,7 @@ public ListNode removeNthFromEnd(ListNode head, int n){ fastIndex = fastIndex.next; } - while (fastIndex.next != null){ + while (fastIndex != null){ fastIndex = fastIndex.next; slowIndex = slowIndex.next; }