Skip to content

[SAM] Week 7 solutions #128

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 5 commits into from
Jun 13, 2024
Merged

[SAM] Week 7 solutions #128

merged 5 commits into from
Jun 13, 2024

Conversation

SamTheKorean
Copy link
Contributor

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

데크 자료 구조를 쓰신 접근도 재밌네요 : )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

메모리를 더 효율적으로 쓸 수 있던데 시간이 나면 다시 짜보겠습니다 ㅎㅎ

Copy link
Member

Choose a reason for hiding this comment

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

앗 리뷰를 빼앗겼네요 🤣
deque을 사용하는 방법도 있었네요!

Copy link
Contributor Author

@SamTheKorean SamTheKorean Jun 11, 2024

Choose a reason for hiding this comment

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

사실 deque를 잘 몰랐었는데 chatgpt에 stack의 아랫부분과 윗부분을 동시에 pop할 수 있는 방법을 물어보니 deque가 그런 자료구조라고 해서 처음 배웠습니다! 그런데 메모리 효율적인 방법은 아닌 것 같네용

@SamTheKorean SamTheKorean marked this pull request as ready for review June 11, 2024 02:48
Comment on lines +10 to +16
while current:
if p.val > current.val and q.val > current.val:
current = current.right
elif p.val < current.val and q.val < current.val:
current = current.left
else:
return current
Copy link
Member

Choose a reason for hiding this comment

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

이 문제가 이렇게 간단히 풀이될 수 있는 거였군요.. 바로 코드 수정하러 갑니다 💨

@SamTheKorean SamTheKorean merged commit dee9e83 into DaleStudy:main Jun 13, 2024
@DaleSeo
Copy link
Member

DaleSeo commented Jun 14, 2024

@SamTheKorean 이터레이션 설정 안 하고 병합하면 미워할꺼야! 😈

@SamTheKorean
Copy link
Contributor Author

오 죄송합니다 ㅠㅠ

crumbs22 added a commit to crumbs22/leetcode-study that referenced this pull request Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants