Error changing Java code

This commit is contained in:
huawuque404
2023-10-26 19:15:25 +08:00
parent ba8415e3f4
commit 28d50d34c6

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