16
What is the output of the following code?
a = [2, -1, 3, -4, 5]
best = cur = a[0]
for x in a[1:]:
cur = max(x, cur + x)
best = max(best, cur)
print(best)DiscussHard