Skip to content

Conversation

gmlwls96
Copy link
Contributor

@gmlwls96 gmlwls96 commented Jan 18, 2025

답안 제출 문제

체크 리스트

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

@gmlwls96 gmlwls96 requested a review from a team as a code owner January 18, 2025 02:36
@gmlwls96 gmlwls96 requested a review from Real-Reason January 18, 2025 02:37
Copy link
Contributor

@obzva obzva left a comment

Choose a reason for hiding this comment

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

안녕하세요 :)
이번 한 주도 수고 많으셨습니다
코멘트 남겨놓았으니 병합 전에 확인 바랍니다
감사합니다!!

s.forEach { // s를 조회하면서 글자를 subStr에 담는다.
if (subStr.contains(it)) { // 단, 겹치는 글자가 있을경우 subStr의 len을 기록하고, 초기화 한다.
max = max(max, subStr.length)
subStr.delete(0, subStr.length)
Copy link
Contributor

Choose a reason for hiding this comment

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

이 로직이 오류를 유발합니다
답안 통과를 하지 못하고 있는데, 인지하고 계신가요?

@@ -0,0 +1,43 @@
class Solution {
// 시간 : O(N), 공간 O(N)
Copy link
Contributor

Choose a reason for hiding this comment

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

문제 설명에서 주어진 변수가 m, n (2차원 배열의 행, 열)이므로 복잡도 분석의 결과를 m, n을 이용해서 표현해주시거나 별도의 추가적인 설명을 곁들여주세요

var answerRoot: ListNode? = null

while (currentHead != null) {
answerRoot = ListNode(currentHead.`val`).apply { next = answerRoot }
Copy link
Contributor

Choose a reason for hiding this comment

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

answerRoot 뒤에 새로운 ListNode 인스턴스를 생성해서 추가하고 있으니까 공간 복잡도가 O(1)이 아닐 것 같아요

Comment on lines +3 to +4
// dp 알고리즘. pathMap[y][x]로 올수 있는 경로의 수는
// 위쪽(pathMap[y - 1][x]) + 왼쪽( pathMap[y][x - 1]) 경로의 수의 합이다.
Copy link
Contributor

Choose a reason for hiding this comment

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

pathMap[y][x] = pathMap[y - 1][x]) + 왼쪽( pathMap[y][x - 1]
이 점화식을 잘 보면 공간복잡도를 1차원으로 줄일 수 있다는 걸 알 수 있습니다
한 번 최적화해보시는 걸 추천드립니다~!

@gmlwls96 gmlwls96 merged commit c2d8d9c into DaleStudy:main Jan 24, 2025
1 check passed
@obzva
Copy link
Contributor

obzva commented Jan 24, 2025

@gmlwls96 longest-substring 문제는 틀린 답안을 수정하지도 않으셨는데 병합 진행하셨네요?
책임감을 갖고 시간 내어 리뷰한 사람에 대한 예의가 아닌 것 같습니다 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants