Skip to content

[robinyoon-dev] WEEK 04 Solutions#2465

Merged
robinyoon-dev merged 6 commits intoDaleStudy:mainfrom
robinyoon-dev:main
Mar 29, 2026
Merged

[robinyoon-dev] WEEK 04 Solutions#2465
robinyoon-dev merged 6 commits intoDaleStudy:mainfrom
robinyoon-dev:main

Conversation

@robinyoon-dev
Copy link
Copy Markdown
Contributor

@robinyoon-dev robinyoon-dev commented Mar 24, 2026

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@junzero741 junzero741 self-requested a review March 26, 2026 08:55
@robinyoon-dev robinyoon-dev moved this from Solving to In Review in 리트코드 스터디 7기 Mar 27, 2026
Copy link
Copy Markdown
Contributor

@junzero741 junzero741 left a comment

Choose a reason for hiding this comment

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

4주차도 고생 많으셨습니다! 👍

Comment on lines +13 to +23
var maxDepth = function (root) {

//NOTE: 현재 노드의 최대 깊이는 왼쪽 자식 트리의 최대 깊이와 오른쪽 자식 트리의 최대 깊이 중 큰 값에 1(현재 노드)을 더한 값
if (root === null) {
return 0;
}

const leftDepth = maxDepth(root.left);
const rightDepth = maxDepth(root.right);

return Math.max(leftDepth, rightDepth) + 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

해설 써주신 것 좋습니다! 풀이도 깔끔하구요!

Comment on lines +15 to +19
if(nums[currentIndex - 1] > nums[currentIndex]){
result = nums[currentIndex];
}else{
continue;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

개인 차는 있겠지만, 저는 else 문이 중괄호랑 간격이 좀 있으면 가독성이 더 좋은 것 같더라구요!

Comment on lines +48 to +55
let hasCharOnTheLeft = dfs(x - 1, y, nextIndex);
let hasCharOnTheRight = dfs(x + 1, y, nextIndex);
let hasCharAtTheTop = dfs(x, y + 1, nextIndex);
let hasCharAtTheBottom = dfs(x, y - 1, nextIndex);

board[x][y] = tempChar;

return hasCharOnTheLeft || hasCharOnTheRight || hasCharAtTheTop || hasCharAtTheBottom;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

has~ 로 4개의 변수를 만들기보단, 1개의 변수로 줄일 수 있을 것 같아요.

const found = dfs(r + 1, c, index + 1) ||
                      dfs(r - 1, c, index + 1) ||
                      dfs(r, c + 1, index + 1) ||
                      dfs(r, c - 1, index + 1);

@robinyoon-dev robinyoon-dev merged commit e486327 into DaleStudy:main Mar 29, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 7기 Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants