Conversation
LeeBaeJin
approved these changes
Apr 20, 2026
|
|
||
| let findNum = n + 1; | ||
|
|
||
| while (42) { |
Collaborator
There was a problem hiding this comment.
오 이렇게 접근하는 방법은 생각 못해봤는데, 한 수 배웠습니다!
doitchuu
approved these changes
Apr 24, 2026
| function solution(n) { | ||
| var answer = 1; | ||
|
|
||
| if (n === 1) return 1; |
| .toString(2) | ||
| .split("") | ||
| .filter((n) => n === "1").length; | ||
| }; |
sik9252
approved these changes
Apr 26, 2026
Collaborator
sik9252
left a comment
There was a problem hiding this comment.
ㅠㅠ 일이 많아서 리뷰 까먹고 있었네요... 고생하셨습니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
이렇게 풀었어요
1. 다음큰숫자
1) 복잡도 계산
2) 접근 아이디어
3) 회고
처음에는 n의 이진수를 구해서 이진수를 가지고 구해보려고 했는데, 깊은 생각이 요구될 것 같아 그냥 하나씩 증가시키면서 구하는 방법으로 풀이했다.
2. 숫자의표현
1) 복잡도 계산
2) 접근 아이디어
3) 회고
천장에서 아래로 내려오면서 더하는 방식으로 풀이했는데 n이 1인 경우 예외 처리를 찾지 못해서 오래 걸렸다. DP로 풀이하는 방법도 있을 것 같고, for문은 한 번만 도는 방법도 있을 것 같은데 한 번 찾아봐야겠다.