-
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
[Jeehay28] WEEK 10 #1010
[Jeehay28] WEEK 10 #1010
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.
@Jeehay28 님, 벌써 10주차도 절반 넘게 푸셨네요!
남은 2문제와 다섯 주차도 깔끔하게 마무리 해주실거라 믿습니다~
아직 풀이중이시니, 우선은 코멘트만 남겨두고 가겠습니다!
// Time Complexity: O(V + E), where V is the number of courses (numCourses) and E is the number of prerequisites (edges). | ||
// Space Complexity: O(V + E), where V is the number of courses and E is the number of prerequisites. | ||
|
||
var canFinish = function (numCourses, prerequisites) { |
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.
0, 1, 2 를 상수로 뽑아 내면 어떨까 싶어요. 깔끔한 풀이네요!
// let queue = [root]; | ||
|
||
// while (queue.length > 0) { | ||
// const node = queue.shift(); |
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.
shift()
의 복잡도는 우선 고려하지 않으신거죠?
실제 코딩 테스트에서도 JS에는 Queue나 Deque이 없기 때문에 우선은 있다고 치고 작성한 뒤 '이 부분은 추가 구현으로 보완 가능하다'고 언급하는 방식으로도 진행한다고 하더라구요.
이전에 달레님의 피드백 중에 비슷한 내용이 있었어서 공유드려요!
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.
아, 그렇군요. 공유 감사합니다. 👍
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.
@Jeehay28 님, 10주차도 고생하셨습니다!
남은 주차도 잘 부탁드려요!!
* @param {ListNode[]} lists | ||
* @return {ListNode} | ||
*/ | ||
var mergeKLists = function (lists) { |
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.
와우,, 주석이 실시간으로 진화하고 있는것같아요 🫢
지금 풀이도 충분히 좋은 풀이지만, merged-k-sorted-lists
라는 이름의 sorted
라는 특성을 활용하지 못한 점이 다소 아쉬어요
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.