Skip to content

Commit 3ed04d1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent eeac644 commit 3ed04d1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

data_structures/arrays/list_maximum_depth_sum.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ def find_sums(arr: list, depth: int):
3232

3333
# Doctests for the new problem
3434
print("--- Max Depth Sum Examples ---")
35-
35+
3636
# Example 1: Max sum at depth 2 (4+5=9)
3737
# >>> calculate_max_depth_sum([1, [4, 5], 2])
3838
# 9
39-
39+
4040
# Example 2: Max sum at depth 1 (10)
4141
# >>> calculate_max_depth_sum([10, [1, [2, 3]]])
4242
# 10
43-
43+
4444
# Example 3: Max sum at depth 3 (100)
4545
# >>> calculate_max_depth_sum([2, [1, [100], 1], 2])
4646
# 100
47-
47+
4848
# Example 4: Nested zeroes and negatives
4949
# The max sum can still be negative if all levels are negative
5050
# >>> calculate_max_depth_sum([-1, [-5, -2], -1])
5151
# -2 # (-1 + -1) vs (-5 + -2) = -7. Max is -2.
5252

5353
# Since the prompt asks for a simpler problem, I will only include basic doctests
5454
# but the implementation provided above works for the complex examples.
55-
55+
5656
# Running basic doctests for validation
5757
class MaxDepthSumTests:
5858
"""
@@ -62,6 +62,7 @@ class MaxDepthSumTests:
6262
>>> calculate_max_depth_sum([10, [1, [2, 3]]])
6363
10
6464
"""
65+
6566
pass
66-
67-
doctest.run_docstring_examples(MaxDepthSumTests, globals())
67+
68+
doctest.run_docstring_examples(MaxDepthSumTests, globals())

0 commit comments

Comments
 (0)