

이 문제에서는 주가가 떨어진 이후 시간들의 주가는 더이상 고려 대상이 아닙니다. 떨어지기 직전까지만 주가가 유지되는 것으로 봅니다.
''' 내가 푼 - 문제 설명 이상하니 아래꺼로 풀어야 함 '''
def solution(prices):
answer = [0 for _ in range(len(prices))]
for i in range(len(prices)):
for j in range(i+1, len(prices)):
if prices[i] > prices[j]:
answer[i] += 1
break
else:
answer[i] += 1
return answer
print(solution([1, 2, 3, 2, 3]))

''' 다른 사람 코드 - 나랑 같음 '''
def solution(prices):
answer = [0] * len(prices)
for i in range(len(prices)):
for j in range(i+1, len(prices)):
if prices[i] <= prices[j]:
answer[i] += 1
else:
answer[i] += 1
break
return answer