Skip to content

Commit 2180748

Browse files
authored
Fixing Leetcode Syntax
1 parent 96c84ba commit 2180748

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

python/21-Merge-Two-Sorted-Lists.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
# self.val = val
55
# self.next = next
66
class Solution:
7-
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
7+
def mergeTwoLists(self, list1: ListNode, list2: ListNode) -> ListNode:
88
dummy = ListNode()
99
tail = dummy
1010

11-
while l1 and l2:
12-
if l1.val < l2.val:
13-
tail.next = l1
14-
l1 = l1.next
11+
while list1 and list2:
12+
if list1.val < list2.val:
13+
tail.next = list1
14+
list1 = list1.next
1515
else:
16-
tail.next = l2
17-
l2 = l2.next
16+
tail.next = list2
17+
list2 = list2.next
1818
tail = tail.next
1919

20-
if l1:
21-
tail.next = l1
22-
elif l2:
23-
tail.next = l2
20+
if list1:
21+
tail.next = list1
22+
elif list2:
23+
tail.next = list2
2424

2525
return dummy.next

0 commit comments

Comments
 (0)