-
-
Notifications
You must be signed in to change notification settings - Fork 195
[Sam] Week 2 solutions #49
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
LGTM 이 Looks good to me 였군요 ㅎㅎ 덕분에 하나 배웁니다! |
@DaleSeo 라벨과 마일스톤까지는 제가 권한이 부여되어서 설정 가능한데 혹시나 싶어서 기록 남깁니다...! |
저장소 쓰기 권한을 드렸으니 이제 되실 거에요 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘 푸셨네요! 👏 Reverse Linked List 풀이가 흥미로워서 피드백 드렸는데 의견 부탁드립니다.
if not node: | ||
continue | ||
|
||
node.left, node.right = node.right, node.left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
파이썬은 이게 한 줄로 되서 넘 편해요 ㅋㅋ
# Space complexity : O(n) | ||
class Solution: | ||
def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]: | ||
stack = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sam 님은 재귀보다는 스택쓰시는 것을 선호하시는 듯?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
당시에 재귀 보다는 스택이 더 이해가 편했는데 이제 조금씩 재귀적 사고에 익숙해지는 것 같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참고로 저는 개인 선호를 존중해요 ㅋㅋ 물론 둘 다 자유자재로 쓸 수 있다면 더 좋겠지만요 😸
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
No description provided.