Skip to content

Conversation

gitsunmin
Copy link
Contributor

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@gitsunmin gitsunmin self-assigned this Oct 3, 2024
@gitsunmin gitsunmin requested a review from a team as a code owner October 3, 2024 23:02
@github-actions github-actions bot added the ts label Oct 3, 2024
@gitsunmin gitsunmin requested a review from JEONGHWANMIN October 3, 2024 23:05
@gitsunmin gitsunmin changed the title Add week 8 solutions: merge-two-sorted-lists [gitsunmin] Week 8 Solutions Oct 3, 2024
current = current.next;
}

current.next = list1 || list2;
Copy link
Contributor

Choose a reason for hiding this comment

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

오 이렇게 하니까 엄청 깔끔하네요 b

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.

@gitsunmin 님 이번 한 주도 고생 많으셨습니다!

function mergeTwoLists(list1: ListNode | null, list2: ListNode | null): ListNode | null {
if (!list1 && !list2) return null;
if (!list1) return list2;
if (!list2) return list1;
Copy link
Contributor

Choose a reason for hiding this comment

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

요렇게 예외 하나씩 콕콕 짚어서 early return 해주는게 코드는 좀 늘겠지만 가독성이 참 좋은것같아요

@SamTheKorean SamTheKorean merged commit bfe247c into DaleStudy:main Oct 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

4 participants