-
-
Notifications
You must be signed in to change notification settings - Fork 247
[minji-go] week 15 solutions #1657
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.
15주차와 8주차 문제를 함께 풀어보는 것도 좋은 방법인 것 같습니다.
같은 문제를 시차를 두고 반복해서 풀면 개념이 더 잘 이해되고 기억에도 오래 남는 것 같아요.
지난 15주 동안 고생 많으셨습니다. 👍 앞으로도 꾸준히 코딩 공부 이어가시길 응원할게요!
int len = Math.max(len1, len2); | ||
if (len > maxLength) { | ||
maxLength = len; | ||
start = i - (len - 1) / 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.
Java에서 int 나눗셈은 소수점 이하를 그냥 잘라버리는 거였군요. JavaScript의 Math.floor()랑은 다른 개념이라 흥미롭네요. 배워갑니다!
|
||
for (int right = 0; right < s.length(); right++) { | ||
char c = s.charAt(right); | ||
count[c - 'A']++; |
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.
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> |
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.
serialization 방식을 사용하면 시간 복잡도를 O(M + N)으로 줄일 수 있습니다. 한번 시도해 보시는 걸 추천드립니다.
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.
시간 복잡도 줄일 생각을 못했네요 :) 감사합니다!
답안 제출 문제
[week15]
[week8]
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!