From be1244ea463dfb3d1d8e10007a3e285b877f0e66 Mon Sep 17 00:00:00 2001 From: Wenru Dong Date: Thu, 11 Oct 2018 17:28:20 +0100 Subject: [PATCH] [Issue 34]fixed bug in merge_sorted_list --- python/07_linkedlist/linked_list_algo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/07_linkedlist/linked_list_algo.py b/python/07_linkedlist/linked_list_algo.py index 9427126..4d69ae8 100644 --- a/python/07_linkedlist/linked_list_algo.py +++ b/python/07_linkedlist/linked_list_algo.py @@ -55,7 +55,7 @@ def merge_sorted_list(l1: Node, l2: Node) -> Optional[Node]: current = current._next current._next = p1 if p1 else p2 return fake_head._next - return p1 or p2 + return l1 or l2 # Remove nth node from the end # 删除倒数第n个节点。假设n大于0