-
-
Notifications
You must be signed in to change notification settings - Fork 195
[seunghyun] Week 2 Solutions #65
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.
바쁘신 와중에 이렇게 올려주신 것만으로 대단합니다. 고생하셨습니다.
저도 Linked List 문제를 좋아하지 않습니다. 포인터를 활용해서 수정하는 것 자체가 조금 직관적으로 와닿지가 않아서 더 헷갈리는거 같아요. 저는 처음에 이해가 안가면 링크드리스트를 표를 그려서 실제로 코드에서 포인터가 어떻게 옮겨가는지 제가 직접 체크를 해봤습니다. 안해보셨다면 이 방법을 한 번 시도해보세요 😄 |
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.
해당 솔루션만 시/공간 복잡도 누락된 것 같습니다 😄
ListNode node2 = node1.next; | ||
head.next = null; | ||
|
||
while (node1 != null && node2 != null) { |
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.
요 부분에서 굳이 node1 까지 확인한 이유가 혹시 있을까요? 위에 이미 head로 지정을 해놓으셔서 이미 while 루프에 들어간 리스트는 list1이 null 이 아님을 확인한 상태인거 같아서요!
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.
재귀로 접근하신게 신선한 것 같네요...! : )
if (stack.isEmpty()) return false; | ||
|
||
if (c == ')') { | ||
Character pop = stack.pop(); |
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.
stack pop 부분이 각 조건문 안에서 반복되어서
빼볼 수 있지 않았을까 하는 생각이 드네요
2주차 문제풀이
현생이슈로 풀이가 많이 늦었습니다 🙏🙏
링크드 리스트에 대한 이해도가 낮아서 자료구조를 더 공부해야겠네요 ㅠㅠ