Skip to content

[hsskey] WEEK 03 solutions #1289

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 5 commits into from
Apr 19, 2025
Merged

[hsskey] WEEK 03 solutions #1289

merged 5 commits into from
Apr 19, 2025

Conversation

hsskey
Copy link
Member

@hsskey hsskey commented Apr 14, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@hsskey hsskey moved this from Solving to In Review in 리트코드 스터디 4기 Apr 18, 2025
@hsskey
Copy link
Member Author

hsskey commented Apr 19, 2025

@yoouyeon 리뷰 요청드려요

Copy link
Contributor

@yoouyeon yoouyeon left a comment

Choose a reason for hiding this comment

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

리뷰가 늦어 죄송합니다 🙇‍♀️💦
흐름에 따라 주석을 잘 남겨주셔서 제가 아직 풀지 않은 문제들도 잘 이해할 수 있었던 것 같습니다 👍
이번 주차 문제 풀이 수고 많으셨습니다 🍀

// 데이터 통합
return total
}
const binaryString = recursive(n)
Copy link
Contributor

Choose a reason for hiding this comment

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

직접 2진수로 변환해서 문자열로 만들어주는 방법도 있지만
동일한 변환 로직을 사용하는 toString 메소드도 있어서 코멘트 남겨봅니다 😊
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Number/toString

Copy link
Member Author

Choose a reason for hiding this comment

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

리뷰주셔서 감사합니다. 직관적으로 떠올린 풀이는 재귀적으로 푸는 현재와 같은 풀이였는데
말씀주신 방법도 다시 한번 풀어보며 다른 풀이도 익숙해질수있게 확인해봐야겠네요 감사합니다 😊

return total
}
const binaryString = recursive(n)
const result = [...binaryString].map(Number).reduce((a,b) => a + b, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

각 숫자들을 더한 결과로 1의 개수를 세는 것은 생각지 못했던 방법이네요..!! 😲

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