def max_zero_sequence(arr):
# your code here
sequence = list()
answers = list()
start = 0
while start < len(arr):
for i in arr[start:]:
sequence.append(i)
if sum(sequence) == 0:
answers.append(sequence)
sequence = []
start += 1
print(answers)
Trying to get the longest sequence of integers, that theirs sum equal zero. In this case, if arr is equal to [1, 2, -3, 7, 8, -16], answer must be [1, 2, -3]. So, can someone explain why python returns [[[1, 2, -3, 7, 8, -16]] ???? The sequence that should be appended to the answers list is [1, 2, -3].