PythiloEasy · 12 min · Task 37 of 100 · progress kept in this browser

Best single trade

Return the largest nonnegative profit from buying then selling once at later indices. Empty or decreasing prices return zero.

earlier_low, price = 1, 6
print(price-earlier_low)
Your task

Return the largest nonnegative profit from buying then selling once at later indices. Empty or decreasing prices return zero.