-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Arthur] Week 3 #783
[Arthur] Week 3 #783
Conversation
} | ||
|
||
return res | ||
} |
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.
linelint에 걸렸어요~ 😵
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.
앗... 복붙하다가 실수를했네요... 감사합니다!
// Time Complexity: O(1) | ||
// Space Complexity: O(1) | ||
func reverseBits(num uint32) uint32 { | ||
reversedBits := bits.Reverse32(num) |
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.
혹시 될까해서 해봤는데 되더라구요ㅋㅋㅋ....
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.
내부 구현이 궁금해서 좀 찾아봤는데, 궁금하시면 한 번 구경해보시죠 ㅎㅎ
https://github.com/golang/go/blob/master/src/math/bits/bits.go
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.
오 이런 함수가 있었군요 ㅎㅎ 덕분에 알아갑니다!
// O(n) | ||
for i, num := range nums { | ||
// O(1) | ||
if j, ok := m[target-num]; ok && j != i { // target = num2 + num1 -> num2 = target - num1 을 이용하여 두 수를 찾는다. |
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.
가독성 좋고 간결한 풀이 잘보았고 덕분에 golang 코드 작성 방식도 배워갑니다! 고생많으셨습니다!
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.