Recent Posts
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Today
Total
관리 메뉴

Try

[Programmers/Python3] 주식가격 본문

Algorithm/Programmers

[Programmers/Python3] 주식가격

HAS3ONG 2019. 3. 8. 19:48
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def solution(prices):
    answer = []
    length = len(prices)
    
    for i in range(0, length):
        count = 0
        for j in range(i, length-1):
            if prices[i] >prices[j]:
                break
            else:
                count +=1
                
        answer.append(count)
    return answer
cs



출처

https://programmers.co.kr/learn/courses/30/lessons/42584?language=python3

Comments