stockprice = [100, 110, 105, 120] 
stack = [0] * len(stockprice)

for i in range(len(stockprice)):
    for j in range(i+1, len(stockprice)):
        if stockprice[j] < stockprice[i]:
            stack[i] = j - i
            break 

print(stack)

Embed on website

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