-
-
Notifications
You must be signed in to change notification settings - Fork 304
[se6816] WEEK 03 Solutions #2103
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
Seoya0512
left a comment
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.
이번주도 문제 푸시느라 고생 많으셨습니다. 다음 주도 화이팅입니다 : )
| } | ||
|
|
||
| /** | ||
| 이전 방식과 동일하나 변수 하나로 이전 값만 유지하는 방식 |
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.
위에 dp를 사용해서 하는 방식도 좋은데 하나의 변수로 처리하는 것도 공간 복잡도를 개선시킬 수 있군요 👍
| */ | ||
| class Solution { | ||
| public int hammingWeight(int n) { | ||
| return Integer.bitCount(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.
Java는 모르지만 bitCount라는 메소드 강력하네요!
| @@ -0,0 +1,37 @@ | |||
| /** | |||
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.
투포인터로 풀이할 생각은 못했는데..한 수 배워갑니다..
devyulbae
left a comment
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.
👍
|
@Seoya0512 안녕하세요! 뭔가 지적을 하려는건 아니고 혹시 모르신다면 도움이 될까하여 말씀드려요
|

답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!