for x in L[mid_index - 1::-1]:
    accum += x
left_half = max(left_half, accum)
accum = 0
for x in L[mid_index:]:
    accum += x
right_half = max(right_half, accum)
return max(left, right, left_half + right_half)
assert find_max([]) == 0
assert find_max([-1]) == 0
assert find_max([1, 2, 3]) == 6
assert find_max([2, -5, 3]) == 3
assert find_max([-5, 1, 4, -2, 2, -1, 2, -3, 1, -3, 4]) == 6
Generative recursion to find the sublist with the maximum sum