Skip to content

[freemjstudio] WEEK 08 Solutions - #2821

Merged
parkhojeong merged 2 commits into
DaleStudy:mainfrom
freemjstudio:freemjstudio-week09
Aug 17, 2026
Merged

[freemjstudio] WEEK 08 Solutions#2821
parkhojeong merged 2 commits into
DaleStudy:mainfrom
freemjstudio:freemjstudio-week09

Conversation

@freemjstudio

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🏷️ 알고리즘 패턴 분석

reverse-bits/freemjstudio.py
class Solution:
    def reverseBits(self, n: int) -> int:
        # 1. convert integer into binary
        binary = bin(n)[2:]

        # 2. convert into 32bits
        fill_zero = 32 - len(binary)
        binary = "0" * fill_zero + binary

        # 3. reverse the binary
        reversed_binary = binary[::-1]

        # 4. convert binary into integer
        return int(reversed_binary,2)
  • 패턴: Bit Manipulation, Divide and Conquer
  • 설명: 주어진 코드는 이진수 표현을 다루며 비트 반전을 수행하는 방식으로, 비트 조작의 아이디어를 직접적으로 사용한다. 또한 입력을 32비트로 고정시키고 역순으로 재배치하는 과정에서 분할 없이 문자열 조작으로 반전하는 방식을 보여준다.

📊 시간/공간 복잡도 분석

복잡도
Time O(1)
Space O(1)

피드백: 정수의 이진 표현을 문자열로 다루고 왼쪽 패딩과 반전을 통해 역순 이진수를 얻는다.

개선 제안: 현재 구현은 직관적이지만, 비트 연산만으로 32비트 반전을 수행하면 더 빠르고 메모리 효율적이다. 예: 비트 마스크와 쉬프트를 이용한 역순 연산으로 O(1) 시간 복잡도를 유지할 수 있다.

💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!

@dalestudy

dalestudy Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

📊 freemjstudio 님의 학습 현황

이번 주 제출 문제

문제 난이도 유형 분석
longest-repeating-character-replacement Medium ✅ 의도한 유형
reverse-bits Easy ⚠️ 유형 불일치

누적 학습 요약

  • 풀이한 문제: 17 / 75개
  • 이번 주 유형 일치율: 50% (2문제 중 1문제 일치)

문제 풀이 현황

카테고리 진행도 완료
Array ■■■■□□□ 5 / 10 (Easy 3, Medium 2)
Heap ■■□□□□□ 1 / 3 (Medium 1)
String ■■□□□□□ 3 / 10 (Medium 1, Easy 2)
Dynamic Programming ■■□□□□□ 3 / 11 (Medium 3)
Matrix ■■□□□□□ 1 / 4 (Medium 1)
Binary ■□□□□□□ 1 / 5 (Easy 1)
Linked List ■□□□□□□ 1 / 6 (Easy 1)
Tree ■□□□□□□ 2 / 14 (Medium 1, Easy 1)
Graph □□□□□□□ 0 / 8 ← 아직 시작 안 함
Interval □□□□□□□ 0 / 5 ← 아직 시작 안 함

🤖 이 댓글은 GitHub App을 통해 자동으로 작성되었습니다.

🔢 API 사용량 (gpt-5-nano)
요청 입력 토큰 출력 토큰 합계 비용
1 315 52 367 $0.000037
2 852 93 945 $0.000080
합계 1,167 145 1,312 $0.000116

@parkhojeong parkhojeong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수고하셨습니다.

스터디 규칙을 아직 숙지하지 못하신 것 같은데 해당 문서 확인 부탁드립니다. https://github.com/DaleStudy/leetcode-study/wiki

Comment thread reverse-bits/freemjstudio.py
@freemjstudio freemjstudio changed the title [freemjstudio] WEEK 09 Solutions [freemjstudio] WEEK 08 Solutions Aug 17, 2026
Comment thread longest-repeating-character-replacement/freemjstudio.py
@parkhojeong
parkhojeong merged commit e912012 into DaleStudy:main Aug 17, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review to Completed in 리트코드 스터디 8기 Aug 17, 2026
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