Skip to content

[Chaedie] Week 3 #767

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 6 commits into from
Dec 28, 2024
Merged

[Chaedie] Week 3 #767

merged 6 commits into from
Dec 28, 2024

Conversation

Chaedie
Copy link
Contributor

@Chaedie Chaedie commented Dec 22, 2024

답안 제출 문제

체크 리스트

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

@Chaedie Chaedie requested a review from a team as a code owner December 22, 2024 23:59
@github-actions github-actions bot added the py label Dec 23, 2024
@Chaedie Chaedie requested a review from KwonNayeon December 23, 2024 00:00
@KwonNayeon
Copy link
Contributor

@Chaedie 님 안녕하세요 한 문제를 풀더라도 여러 번 푸시고, 문제 복기도 꼼꼼히 하신 걸 보고 이번주 소홀히 했던 걸 반성했습니다...ㅠㅠ 천천히 리뷰하도록 하겠습니다!

Comment on lines +42 to +50
# 스스로 풀기
# 한번 더 풀 에정입니다.
def reverseBits(self, n: int) -> int:
result = 0
for i in range(32):
result = result << 1
result = result | (n & 1)
n = n >> 1
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.

저는 string manipulation을 이용해서 문제를 풀었는데, 비트 연산을 이용한 다양한 풀이방법을 배울 수 있었습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

감사합니다..! 문제의 취지가 "비트 연산 사용해보기"인것 같아서 비트 위주로 풀어보았습니다..!

Comment on lines +13 to +21
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
num_map = {} # num : index

for i, val in enumerate(nums):
diff = target - val
if diff in num_map:
return [num_map[diff], i]
num_map[val] = i
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²)�였는데, 해시맵을 사용하면 시간 복잡도를 줄일 수 있다는 걸 알게 되었습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

브루트 포스 -> sort -> hash map 등등 다양한 풀이가 있더라구요. 감사합니다.

@Chaedie Chaedie merged commit 063fe9f into DaleStudy:main Dec 28, 2024
3 checks passed
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.

2 participants