DevYoon
[프로그래머스] 주식가격 (Python) 본문
link 🔗 https://programmers.co.kr/learn/courses/30/lessons/42584
def solution(prices):
answer = [0]*len(prices)
idx = 0
while idx < len(prices):
cost = prices[idx]
for i in range(idx+1, len(prices)):
if cost > prices[i]:
answer[idx] += 1
break
else:
answer[idx] += 1
idx += 1
return answer