This repository was archived by the owner on Mar 18, 2024. It is now read-only.
[2023-10-02] wooyeol #296 #314
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.
PR Summary
주식가격
https://school.programmers.co.kr/learn/courses/30/lessons/42584?language=python3
풀이시간
11:30 ~ 11:50 (20분)
문제 조건
1 <= prices의 각 가격 <= 10,000
2 <= prices의 길이 <= 100,000
시간 복잡도 :
O(N(N+1)/2)
접근법
무슨 알고리즘으로 풀이 할 수 있을까? -> 큐 와 스택
문제를 잘못 읽어 10,000개의 데이터 인줄 알고 시간 복잡도를 생각하지않고 풀이했는데
다시보니 100,000개인 것을 확인하였습니다.
그럼 이 풀이로는 풀이가 되지 않아야하는 의아함이 들어 다른 풀이를 참조하였습니다.
풀이 참고 : https://velog.io/@soo5717/프로그래머스-주식가격-Python
해당 풀이를 참고했을 때 2배 정도 빠른 효율성 테스트 결과를 확인 할 수 있었습니다.