Skip to content

Conversation

@rivkode
Copy link
Member

@rivkode rivkode commented Oct 25, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

Copy link
Contributor

@Lustellz Lustellz left a comment

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.

자바에 toBinaryString 같은 함수가 존재하는지 몰랐네요!

int cnt = 0;
for (int j=0; j < bit.length(); j++) {
char c = bit.charAt(j);
int num = c-'0';
Copy link
Contributor

Choose a reason for hiding this comment

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

이 코드가 어떤 역할을 하는 건지 궁금해요. 무작정 2로 나눠서 몫과 나머지를 통해 답을 도출한다는 생각만 했더니...

Copy link
Member Author

Choose a reason for hiding this comment

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

안녕하세요 ㅎㅎ 아스키 코드를 사용하였습니다. 여기서 char c 는 숫자형태의 char 를 기대하고 있습니다. 그러므로 '0' 을 빼주게 되면 십진법의 Int 숫자가 반환되게 됩니다. 사실 십진법에 해당하는 48을 빼주어도 되는데 '0' 을 빼주는게 더 직관적이라 보통 숫자연산을 할때 저는 '0' 을 빼줍니다. 그러면 원하는 숫자 int 값을 얻을 수 있게 되어서요.

Copy link
Contributor

Choose a reason for hiding this comment

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

제가 문제를 안 읽어서... poll, offer라는 함수를 쓰는 걸 처음 봤네요. 반환, 추가의 역할을 하나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

네 맞아요 poll은 Queue 자료구조에서 가장 첫번째로 들어온 요소를 반환하고 Queue에서 제거합니다. offer은 가장 마지막에 추가하는 역할을 합니다

@rivkode rivkode removed the request for review from delight010 October 25, 2025 14:32
@rivkode rivkode merged commit c65df35 into DaleStudy:main Oct 25, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 5기 Oct 25, 2025
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.

2 participants