Skip to content

[YeomChaeeun] Week 14 #1091

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

Merged
merged 3 commits into from
Mar 16, 2025
Merged

[YeomChaeeun] Week 14 #1091

merged 3 commits into from
Mar 16, 2025

Conversation

YeomChaeeun
Copy link
Contributor

@YeomChaeeun YeomChaeeun commented Mar 10, 2025

답안 제출 문제

Week 13

Week 14

체크 리스트

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Queue 를 사용한 BFS로 문제를 잘 풀어주셨네요!
공간복잡도를 최적화 하기 위해 DFS 문제 풀이도 도전해보시면 재미있을것 같습니다!

Copy link
Contributor

@TonyKim9401 TonyKim9401 left a comment

Choose a reason for hiding this comment

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

14주차 문제 풀이 고생하셨습니다!
어느덧 15주차 마지막주가 다가왔네요.
아무쪼록 지난 15주 동안 릿코드 스터디가 많은 도움이 되셨으면 좋겠습니다.
다음주에 뵙겠습니다!

Comment on lines +7 to +25
function countBits(n: number): number[] {
const result: number[] = [];

// 비트 연산을 이용해 1의 개수를 세는 함수 - O(log n)
function countOnes(num: number): number {
let count = 0;
while (num > 0) {
num &= (num - 1); // 가장 오른쪽의 1 비트를 제거
count++;
}
return count;
}

for (let i = 0; i <= n; i++) {
result.push(countOnes(i));
}

return result;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@YeomChaeeun 님 안녕하세요!
코드의 가독성이 좋고, 비트 연산 방식이 제가 사용한 방법보다 더 효율적이어서 도움이 되었습니다. 여유가 된다면, DP로도 풀어보는 것을 추천드립니다! 이번 주도 고생하셨습니다 👍

@YeomChaeeun YeomChaeeun merged commit 7d1ef57 into DaleStudy:main Mar 16, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Solving to Completed in 리트코드 스터디 3기 Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants