CodingGame/Python/Medium_Challenges/stock_exchange_losses.py
2022-03-13 19:40:00 +01:00

10 lines
212 B
Python

n = int(input())
max = 0
max_lost = 0
for i in input().split():
curr_lost = int(i) - max
if (curr_lost < max_lost):
max_lost = curr_lost
if (int(i) > max):
max = int(i)
print(max_lost)