Skip to content
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

Merged
merged 4 commits into from
Dec 28, 2024
Merged

[Arthur] Week 3 #783

merged 4 commits into from
Dec 28, 2024

Conversation

changchanghwang
Copy link
Contributor

@changchanghwang changchanghwang commented Dec 26, 2024

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

}

return res
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linelint에 걸렸어요~ 😵

Copy link
Contributor Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한 수 배워갑니다 ㅎㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 될까해서 해봤는데 되더라구요ㅋㅋㅋ....

Copy link
Contributor

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

Copy link
Contributor

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 을 이용하여 두 수를 찾는다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 정말 간결하군요!

Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가독성 좋고 간결한 풀이 잘보았고 덕분에 golang 코드 작성 방식도 배워갑니다! 고생많으셨습니다!

@changchanghwang changchanghwang merged commit 5d19a8c into DaleStudy:main Dec 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants