-
-
Notifications
You must be signed in to change notification settings - Fork 195
[ready-oun] Week 03 solutions #1292
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
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.
👍
공간복잡도 최적화를 하고 싶으시다면 StringBuilder를 사용하지 않는 방법도 고려해보면 좋을 것 같습니다.
if ((n & 1) == 1) { | ||
count++; | ||
} | ||
n = n >>> 1; |
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.
👍
>>
이 아닌 >>>
에 대해 찾아 볼 수 있었습니다.
0으로 채우다보니 while 조건도 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.
👍
DFS 풀이보다 더 깔끔한 것 같아서 참고해보겠습니다!
target에서 빼면서 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.
감사합니다! 이 정도 난이도는 처음 풀어봐서 많이 어려웠는데 백트래킹에 대해서 공부할 수 있는 시간이었습니다 ㅎㅎ 머지하겠습니다 !
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!