스택/큐
-
[💕 프로그래머스 Python] 주식가격Algorithm/1일 1코테 2020. 10. 24. 10:59
프로그래머스 연습문제 2단계 스택/큐 [ 주식가격 ] 문제 및 문제설명 programmers.co.kr/learn/courses/30/lessons/42584 코딩테스트 연습 - 주식가격 초 단위로 기록된 주식가격이 담긴 배열 prices가 매개변수로 주어질 때, 가격이 떨어지지 않은 기간은 몇 초인지를 return 하도록 solution 함수를 완성하세요. 제한사항 prices의 각 가격은 1 이상 10,00 programmers.co.kr 내가 제출한 답 # 1차시도 break를 안걸었더니 작은 값을 만나도 뒤에 큰 값을 모두 count하고 끝남 또한 i 바로 뒤 작은 값을 만나더라도 1이 return 되어야 하는데 0으로 return 됨 # 1차 시도 - 탈락 def solution(prices):..