prices = [7, 1, 5, 3, 6, 4]
answer = 0
idx = 0
min_price = 100

for i in range(len(prices)):
    if prices[i] < min_price:
        min_price = prices[i]
    elif prices[i] - min_price > answer:
        answer = prices[i] - min_price
            
print(answer)

Embed on website

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