-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jungsiroo] Week 5 #860
[jungsiroo] Week 5 #860
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4문제 푸시느라 수고 많으셨습니다! 모두 잘 푸셔서 승인에 영향을 줄 만한 중요한 피드백은 없어요 :)
|
||
for day in range(days): | ||
min_price = min(prices[day], min_price) | ||
prices[day] -= min_price |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오, 입력 리스트를 변경하시군요. 신선한 접근입니다!
재귀 방식의 경우, 만약 문자열의 길이가 굉장히 길다면 그만큼의 콜이 일어나고 이는 성능적으로 느려질 수 있음. | ||
두 가지 모두 시간 복잡도 면에서는 O(m) 임 (m = len(string)) | ||
|
||
Node 클래스를 따로 두어 처리하면 가독성 높게 처리할 수 있다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네, 덕분에 코드가 읽기 쉽네요 🙌
Time Complexity : O(n^2) | ||
Space Complexity : O(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
알고리즘의 성능에 영향을 주는 입력 인자가 2개이니 복잡도 분석도 2개의 변수로 표현해야 하지 않을까요?
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.