Skip to content

[OstenHun] WEEK 03 Solutions#2435

Open
OstenHun wants to merge 3 commits intoDaleStudy:mainfrom
OstenHun:main
Open

[OstenHun] WEEK 03 Solutions#2435
OstenHun wants to merge 3 commits intoDaleStudy:mainfrom
OstenHun:main

Conversation

@OstenHun
Copy link
Member

@OstenHun OstenHun commented Mar 16, 2026

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

Copy link
Contributor

@hwi-middle hwi-middle left a comment

Choose a reason for hiding this comment

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

안녕하세요. C++로 풀이한 PR이 올라온 것을 보고 반가움을 느껴 저도 허겁지겁 PR을 올려서 Reviewer로 달려왔습니다. 리뷰 시점에는 2문제를 해결하셨는데, 일단 Approve 처리하겠습니다. 나머지 문제도 해결하신 후 리뷰 원히시면 편하게 멘션주세요!

Comment on lines +37 to +40
// unsigned int answer = 0;
// for (int i = 0; i < 32; i++) {
// if ((n >> i) & 1) answer++;
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

가독성은 이 쪽이 더 좋은 것 같기는 한데,

Comment on lines +29 to +34
unsigned int answer = 0;
while(n>0) {
if (n & 1)
answer++;
n = n >> 1;
}
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
Member Author

Choose a reason for hiding this comment

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

동의합니다.. 정말 깔끔한 거 같아요.
32번보다 적게 확인하는 법이 없을까? 하다가 작성하게 됐네요

저에게 큰 충격을 준건 마지막 풀이였네요. 제가 생각한 건 아니고 AI와 대화 하다 보니 알게 된 풀이인데
정말 멋진 풀이 같습니다

Comment on lines +74 to +75
if (tolower(s[left]) != tolower(s[right]))
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Number of 1 Bits 문제의 여러 해답을 제출하신 걸 보니... 혹시 비트 트릭을 좋아하시나요? 👀 그렇다면 이미 아실 것 같지만, ASCII 코드에서 A65이고 a9732만큼 차이나는 것을 이용하여 비트 연산 한 번으로 대소문자 변환을 구현하는 방법이 있습니다. 물론, 숫자 입력에는 써먹을 수 없어서 이 문제에서는 std::tolower를 써야하지만 이런 부분에 흥미를 느끼실 것 같아 남겨봅니다 :)

Copy link
Member Author

Choose a reason for hiding this comment

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

이전에 배웠다는 기억은 있으나 기억의 저편에 있던 내용이네요 ㅎㅎ; 비트 연산은 언제 봐도 정말 멋진 거 같아요
리뷰 정말 감사합니다. 정말 많은 도움이 되네요! 영상도 잘 봤습니다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Solving

Development

Successfully merging this pull request may close these issues.

2 participants