Skip to content

Conversation

minji-go
Copy link
Contributor

@minji-go minji-go commented Jul 7, 2025

답안 제출 문제

[week15]

[week8]

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@minji-go minji-go moved this from Solving to In Review in 리트코드 스터디 4기 Jul 10, 2025
Copy link
Contributor

@Jeehay28 Jeehay28 left a comment

Choose a reason for hiding this comment

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

15주차와 8주차 문제를 함께 풀어보는 것도 좋은 방법인 것 같습니다.
같은 문제를 시차를 두고 반복해서 풀면 개념이 더 잘 이해되고 기억에도 오래 남는 것 같아요.
지난 15주 동안 고생 많으셨습니다. 👍 앞으로도 꾸준히 코딩 공부 이어가시길 응원할게요!

int len = Math.max(len1, len2);
if (len > maxLength) {
maxLength = len;
start = i - (len - 1) / 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Java에서 int 나눗셈은 소수점 이하를 그냥 잘라버리는 거였군요. JavaScript의 Math.floor()랑은 다른 개념이라 흥미롭네요. 배워갑니다!


for (int right = 0; right < s.length(); right++) {
char c = s.charAt(right);
count[c - 'A']++;
Copy link
Contributor

Choose a reason for hiding this comment

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

Java는 'A' - 'A' 같은 문자 연산도 지원하네요! 와우! 👍

* <a href="https://leetcode.com/problems/subtree-of-another-tree/">week15-1. subtree-of-another-tree</a>
* <li>Description: Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot </li>
* <li>Topics: Tree, Depth-First Search, String Matching, Binary Tree, Hash Function</li>
* <li>Time Complexity: O(N*M), Runtime 2ms </li>
Copy link
Contributor

Choose a reason for hiding this comment

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

serialization 방식을 사용하면 시간 복잡도를 O(M + N)으로 줄일 수 있습니다. 한번 시도해 보시는 걸 추천드립니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

시간 복잡도 줄일 생각을 못했네요 :) 감사합니다!

@minji-go minji-go moved this from In Review to Completed in 리트코드 스터디 4기 Jul 11, 2025
@minji-go minji-go moved this from Completed to In Review in 리트코드 스터디 4기 Jul 11, 2025
@minji-go minji-go merged commit b2521d0 into DaleStudy:main Jul 11, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Jul 11, 2025
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