from collections import deque
def solution(prices):
answer = []
prices = deque(prices)
while prices:
value = 0
standard = prices.popleft()
for i in prices:
if standard > i:
value += 1
break
value += 1
answer.append(value)
return answer
[프로그래머스 코딩테스트 고득점 kit] 카펫 python (0) | 2022.01.23 |
---|---|
[Python] 리스트를 배열로 만들기 (0) | 2022.01.10 |
[Python] 리스트 슬라이싱 (0) | 2022.01.07 |
[프로그래머스 코딩 테스트 고득점 kit] K번째 수 (0) | 2022.01.07 |
[Python]10진수 -> 2진수 변환 함수, 2진수 -> 10진수 변환 함수 (0) | 2022.01.04 |
댓글 영역