diff --git a/data_structures/linked_list/merge_sort_linked_list.py b/data_structures/linked_list/merge_sort_linked_list.py index c06041787..9bebf0b5c 100644 --- a/data_structures/linked_list/merge_sort_linked_list.py +++ b/data_structures/linked_list/merge_sort_linked_list.py @@ -47,7 +47,7 @@ def get_middle(head: Node | None) -> Node | None: slow = head # one node at a time fast = head # two nodes at a time while fast.next and fast.next.next: - slow = slow.next + slow: Node | None = slow.next fast = fast.next.next return slow