Merge pull request #2319 from huawuque404/master

Error changing Java code
This commit is contained in:
程序员Carl
2023-11-02 10:00:27 +08:00
committed by GitHub

View File

@ -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;
}