-
-
Notifications
You must be signed in to change notification settings - Fork 195
[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
Conversation
@yoouyeon 리뷰 요청드려요 |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
There was a problem hiding this 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) | ||
const result = [...binaryString].map(Number).reduce((a,b) => a + b, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
각 숫자들을 더한 결과로 1의 개수를 세는 것은 생각지 못했던 방법이네요..!! 😲
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!