Skip to content

Commit 344c518

Browse files
committed
added changes
1 parent d66b0f5 commit 344c518

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

list_recursion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Test Data: [1, 2, [3,4], [5,6]]
33
Expected Result: 21 """
44

5-
# Solution
5+
# Solution 1
66
def recurs_list(lst):
77
count = 0
88
for i in lst:
@@ -15,7 +15,7 @@ def recurs_list(lst):
1515
data = [1, 2, [3,4], [5,6]]
1616
print(recurs_list(data)) # Output -> 21
1717

18-
# Solution using reduce function
18+
# Solution 2 using reduce function
1919
# The reduce function is used to compute a single value from a sequence by
2020
# successively combining elements using a binary function and an optional initial value.
2121
from functools import reduce

0 commit comments

Comments
 (0)