[20251023] PGM / LV2 / 주식가격 / 강신지 #1205
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/42584
🧭 풀이 시간
10분
👀 체감 난이도
✏️ 문제 설명
초 단위로 기록된 주식가격이 담긴 배열 prices가 주어질 때, 가격이 떨어지지 않은 기간은 몇 초인지를 return 하라
🔍 풀이 방법
주식 가격이 최소일 때만 (prices 배열 길이)-(현재 인덱스)-1을 answer에 저장하도록 했고, 나머지는 무식하게 풀었다.
⏳ 회고