Skip to content

Conversation

rivkode
Copy link
Member

@rivkode rivkode commented Jan 2, 2025

답안 제출 문제

체크 리스트

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

@rivkode rivkode requested a review from taewanseoul January 2, 2025 16:44
@rivkode rivkode self-assigned this Jan 2, 2025
@rivkode rivkode requested a review from a team as a code owner January 2, 2025 16:44
@github-actions github-actions bot added the py label Jan 2, 2025
@rivkode rivkode changed the title add week 4 merge-two-sorted-lists [rivkode] Week4 Jan 2, 2025
Copy link
Contributor

@taewanseoul taewanseoul left a comment

Choose a reason for hiding this comment

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

아직 풀이 중이셔서 간단히 코멘트 남깁니다!

Comment on lines +17 to +31
# 두 리스트를 순회하며 병합
while list1 and list2:
if list1.val <= list2.val:
current.next = list1
list1 = list1.next
else:
current.next = list2
list2 = list2.next
current = current.next

# 남아 있는 노드 처리
if list1:
current.next = list1
elif list2:
current.next = list2
Copy link
Contributor

@taewanseoul taewanseoul Jan 3, 2025

Choose a reason for hiding this comment

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

# 두 리스트를 순회하며 병합 부분을 수정해서 # 남아 있는 노드 처리 부분을 제거할 수 있게끔 수정해 보는 것도 나쁘지 않을 것 같습니다~

Copy link
Member Author

Choose a reason for hiding this comment

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

@taewanseoul 안녕하세요 ! 리뷰 남겨주셔서 감사합니다.
혹시 그럼 남아있는 노드를 제거 하기 위해서 저 if else 부분을 while문에 같이 넣는 방법일까요 ?

로직 순서를 말씀하신건지 혹은 아예 저 남아있는 노드 처리 부분을 없애고 다른 방법을 찾아보는건지 궁금합니다 ㅎㅎ

Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

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

좋은 논의가 있었군요! 논의가 끝나지 않은 것 같지만 주차별 문제 정리를 위해 병합하겠습니다! 이야기는 병합된 pr에서 이어가주셔도 됩니다 ㅎㅎ

@SamTheKorean SamTheKorean merged commit 9bd4f49 into DaleStudy:main Jan 5, 2025
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.

3 participants