-
-
Notifications
You must be signed in to change notification settings - Fork 195
[moonjonghoo] WEEK 11 Solutions #1579
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
base: main
Are you sure you want to change the base?
Conversation
|
||
function dfs(node) { | ||
if (node === null) return 0; // 6) Base Case | ||
const left = Math.max(dfs(node.left), 0); // 8) Pruning |
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.
재귀 함수로 명확하게 짜신 것 같네요!, 저도 풀 떄 참고하겠습니다.
const merged = []; | ||
for (const interval of intervals) { | ||
// 2) 결과 배열의 마지막 구간 | ||
const last = merged[merged.length - 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.
마지막 구간을 확실히 분리해서 관리하니까 코드가 명확하네요
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.
수고하셨습니다!
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!