[프로그래머스] 스택/큐 - 주식가격 (Level 2)

imyo·2020년 9월 14일
0

알고리즘

목록 보기
1/39
post-thumbnail

주식가격


Python Code

def solution(prices):
    answer = []
    for i in range(len(prices)):
        count = 0
        for j in range(i, len(prices)):
            if prices[i]>prices[j]:
                answer.append(count)
                break
            else:
                if j == len(prices)-1:
                    answer.append(count)
                count += 1
    return answer
profile
(●⁰౪⁰●)

0개의 댓글