Skip to content
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

[SunaDu] Week 9 #991

Merged
merged 8 commits into from
Feb 8, 2025
Merged

[SunaDu] Week 9 #991

merged 8 commits into from
Feb 8, 2025

Conversation

dusunax
Copy link
Member

@dusunax dusunax commented Feb 5, 2025

답안 제출 문제

체크 리스트

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

@dusunax dusunax self-assigned this Feb 5, 2025
@dusunax dusunax requested a review from a team as a code owner February 5, 2025 05:49
@github-actions github-actions bot added the py label Feb 5, 2025
@dusunax dusunax requested a review from mintheon February 5, 2025 05:49
Copy link
Contributor

@TonyKim9401 TonyKim9401 Feb 6, 2025

Choose a reason for hiding this comment

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

파이썬의 min 함수를 사용하여 간단한 풀이를 보여주셨네요!
해당 문제의 키포인트는 어떻게 하면 O(log n) 의 시간 복잡도로 최솟값을 찾을 수 있을까를 물어보는 문제입니다.
다시 한번 풀어보시면 좋을것 같아요!

Copy link
Member Author

@dusunax dusunax Feb 6, 2025

Choose a reason for hiding this comment

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

키포인트를 놓쳤는데 submit이 통과되어서 혼자 풀었다면 왜 medium이지?하고 놓쳤을 것 같아요
리뷰 감사합니다!!🙌

# 153. Find Minimum in Rotated Sorted Array
> **why binary search works in a "rotated" sorted array?**
> rotated sorted array consists of **two sorted subarrays**, and the minimum value is the second sorted subarray's first element.
> so 👉 find the point that second sorted subarray starts.
>
> - if nums[mid] > nums[right]? => the pivot point is in the right half.
> - if nums[mid] <= nums[right]? => the pivot point is in the left half.
> - loop until left and right are the same.

def findMinBS(self, nums: List[int]) -> int:
left = 0
right = len(nums) - 1
while left < right:
mid = (left + right) // 2
if nums[mid] > nums[right]:
left = mid + 1
else:
right = mid
return nums[left]

Copy link
Contributor

Choose a reason for hiding this comment

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

LinkedList의 특성을 잘 살려서 풀이해주신것 같습니다 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

이번주 2번째로 어려웠던 문제라고 생각되는데요.
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.

9주차 문제 풀이도 고생 많으셨습니다!
개인적으로 Find minimum in rotated sorted array 문제는 꼭 다시 풀어보셨으면 좋겠어요!
의외로 함정이 숨어있는 문제라고 생각되네요 ㅎㅎ
10주차 문제 풀이도 파이팅입니다!

@dusunax dusunax changed the title [SunaDu] Week 09 [SunaDu] Week 9 Feb 6, 2025
@dusunax dusunax merged commit 22ede51 into DaleStudy:main Feb 8, 2025
1 check passed
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