mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Fix
This commit is contained in:
parent
5556acb7f8
commit
4aa953e400
|
@ -47,7 +47,7 @@ def get_middle(head: Node | None) -> Node | None:
|
||||||
slow = head # one node at a time
|
slow = head # one node at a time
|
||||||
fast = head # two nodes at a time
|
fast = head # two nodes at a time
|
||||||
while fast.next and fast.next.next:
|
while fast.next and fast.next.next:
|
||||||
slow = slow.next
|
slow: Node | None = slow.next
|
||||||
fast = fast.next.next
|
fast = fast.next.next
|
||||||
return slow
|
return slow
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user