-
-
Notifications
You must be signed in to change notification settings - Fork 244
[njngwn] Week 13 Solutions #1947
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.
13주차 문제 풀이 고생하셨습니다!
풀이중 어려운 부분은 없으셨는지 아이디어는 잘 떠오르셨는지 궁금하네요.
뭐든 좋으니 의견을 PR에 함께 올려주시면 리뷰하는데 많은 도움이 될 것 같습니다.
앞으로 남은 단 2주 마무리 잘 하시고 유종의 미를 거두시길 바랍니다.
파이팅입니다!
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.
코드가 깔끔하네요! 체크리스트 토글해 주셔도 좋을 것 같습니다. 수고하셨습니다!
*/ | ||
class Solution { | ||
int cnt = 0; | ||
int result = 0; |
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.
다음에 제안한 조기 종료를 위해 Sentinel Value로 변경합니다.
int result = 0; | |
int result = -1; |
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.
아 그렇군요!! 하나 배워갑니다! 피드백 감사드려요
result = node.val; | ||
return; | ||
} | ||
if (node.right != null) traverseInOrder(node.right); |
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 (node.right != null) traverseInOrder(node.right); | |
if (result == -1 && node.right != null) traverseInOrder(node.right); |
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!