profits = [10, -4, 3, 1, -5, 6]

current = profits[0]
max_profit = profits[0]

for i in range(1, len(profits)):
    current = max(profits[i], current + profits[i])
    max_profit = max(max_profit, current)

print(max_profit)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: