Skip to content

Commit 5f852d3

Browse files
committed
update function comments
1 parent f32e3d4 commit 5f852d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Python/chapter02/2.5 - Sum Lists/miguel_2.5_soln.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ def sum_lists_forward(ll1: LinkedList, ll2: LinkedList) -> LinkedList:
138138
"""
139139
Will add ll1 and ll2 where each element in the linked lists
140140
represent digits.
141-
Precondition: ll1 and ll2 must be the same length.
141+
Note: Each element in the input linked lists MUST be values
142+
between 0-9
142143
Digits are in forward order, for example:
143144
Input: (6 -> 1 -> 7) + (2 -> 9 -> 5). That is, 617 + 295
144145
Output: 9 -> 1 -> 2. That is, 912
@@ -245,6 +246,8 @@ def sum_lists(ll1: LinkedList, ll2: LinkedList) -> LinkedList:
245246
"""
246247
Will add ll1 and ll2 where each element in the linked lists
247248
represent digits.
249+
Note: Each element in the input linked lists MUST be values
250+
between 0-9
248251
Digits are in backward order, for example:
249252
Input: (7 -> 1 -> 6) + (5 -> 9 -> 2). That is, 617 + 295
250253
Result: 2 -> 1 -> 9. That is, 912

0 commit comments

Comments
 (0)