Skip to content
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

Merged
merged 6 commits into from
Feb 16, 2025
Merged

[Jeehay28] WEEK 10 #1010

merged 6 commits into from
Feb 16, 2025

Conversation

Jeehay28
Copy link
Contributor

@Jeehay28 Jeehay28 commented Feb 9, 2025

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@Jeehay28 Jeehay28 requested a review from HodaeSsi February 9, 2025 11:30
@Jeehay28 Jeehay28 requested a review from a team as a code owner February 9, 2025 11:30
@github-actions github-actions bot added the js label Feb 9, 2025
Copy link
Contributor

@HC-kang HC-kang left a 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) {
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shift()의 복잡도는 우선 고려하지 않으신거죠?

실제 코딩 테스트에서도 JS에는 Queue나 Deque이 없기 때문에 우선은 있다고 치고 작성한 뒤 '이 부분은 추가 구현으로 보완 가능하다'고 언급하는 방식으로도 진행한다고 하더라구요.

이전에 달레님의 피드백 중에 비슷한 내용이 있었어서 공유드려요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아, 그렇군요. 공유 감사합니다. 👍

Copy link
Contributor

@HC-kang HC-kang left a 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) {
Copy link
Contributor

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라는 특성을 활용하지 못한 점이 다소 아쉬어요

@SamTheKorean SamTheKorean merged commit 26c70fa into DaleStudy:main Feb 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants