코딩테스트 연습 > 스택/큐 > 주식가격

파이톨치·2022년 1월 29일
1
post-thumbnail

문제 링크

https://programmers.co.kr/learn/courses/30/lessons/42584

코드

#파이썬 코드
def solution(prices):
    answer = [0] * len(prices)
    
    for i in range(len(prices)):
        for j in range(i+1, len(prices)):
            a = prices[i]
            b = prices[j]
            
            answer[i] += 1
            if a > b:
                break
                
    return answer
profile
안알랴줌

0개의 댓글