Skip to content

[lhc0506] WEEK 1 solutions #1169

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

Merged
merged 7 commits into from
Apr 4, 2025
Merged

[lhc0506] WEEK 1 solutions #1169

merged 7 commits into from
Apr 4, 2025

Conversation

lhc0506
Copy link
Contributor

@lhc0506 lhc0506 commented Apr 1, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@minji-go minji-go self-requested a review April 1, 2025 15:59
Copy link
Contributor

@minji-go minji-go left a comment

Choose a reason for hiding this comment

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

안녕하세요 🥰
전반적으로 코드가 깔끔해서 가독성이 너무 좋네요.
나머지 3문제도 어떻게 푸실지 기대됩니다 👍

파일의 마지막에 개행 문자를 추가해주시면 좋을거 같습니다
답안-제출-가이드 참고해보세요!

@lhc0506
Copy link
Contributor Author

lhc0506 commented Apr 2, 2025

안녕하세요 🥰 전반적으로 코드가 깔끔해서 가독성이 너무 좋네요. 나머지 3문제도 어떻게 푸실지 기대됩니다 👍

파일의 마지막에 개행 문자를 추가해주시면 좋을거 같습니다 답안-제출-가이드 참고해보세요!

안녕하세요 리뷰 감사드립니다!
혹시 개행문자가 포함이 안되어있다고 보이실까요??
fileChange 보면 아래 사진과 같은 EOL 에러는 안나고있어서요!
image

@minji-go
Copy link
Contributor

minji-go commented Apr 2, 2025

옷!! 제가 착각했나봅니다 😅
나머지 문제 풀이도 화이팅입니다 !!

Comment on lines 13 to 24
while(numSet.has(currentNum)) {
numSet.delete(currentNum)
currentNum += 1;
currentLength += 1;
}

currentNum = num - 1;
while(numSet.has(currentNum)) {
numSet.delete(currentNum)
currentNum -= 1;
currentLength += 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

O(n)으로 구현을 잘하신거 같네요 👍👍

while문 두 개가 currentNum += 1, currentNum +=(-1) 로 더하는 값만 다르고,
동일한 기능을 수행하고 있으니 메소드로 추출해보는 것도 좋을 거 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a6a966b

꼼꼼한 리뷰 감사합니다!

@lhc0506 lhc0506 moved this from Solving to In Review in 리트코드 스터디 4기 Apr 4, 2025
Comment on lines +10 to +11
let twoBefore = 0;
let oneBefore = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

변수 두개로 공간 복잡도를 줄이니 가독성이 좋네요 👏

@lhc0506 lhc0506 merged commit a1685a6 into DaleStudy:main Apr 4, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Apr 4, 2025
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.

2 participants