Skip to content

Conversation

imsosleepy
Copy link
Contributor

답안 제출 문제

체크 리스트

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

@imsosleepy imsosleepy self-assigned this Jan 11, 2025
@imsosleepy imsosleepy requested a review from a team as a code owner January 11, 2025 14:31
Copy link
Contributor

@donghyeon95 donghyeon95 left a comment

Choose a reason for hiding this comment

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

요번 주도 고생 많으셨습니다~~^^
날씨도 추운데 건강 조심하시고
다음 주도 화이팅입니다~~

@@ -0,0 +1,40 @@
// 투포인터를 쓸 필요 없음. 그냥 최소값을 찾아 빼주면 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.

2가지 방식을 모두 생각해보신 것 너무 좋은데요?
저는 풀기에 바빴는데, 배우고 갑니다

// 아이디어로 푸는 문제라 선호하지 않는 문제...
// 그냥 사용하지 않는 것을 구분자로 두고 스플릿하는게 가장 편하다. 아예 나오지 않을 문자를 기준으로 두면 길이를 알 필요가 없기 때문
public class Solution {
// 인코딩 메서드
Copy link
Contributor

Choose a reason for hiding this comment

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

이건 사소한 건데 Delimeter를 인스턴스 변수로 두고 쓰면 좋을 거 같아요

}

int length = Integer.parseInt(s.substring(i, j));
decodedList.add(s.substring(j + 1, j + 1 + length));
Copy link
Contributor

Choose a reason for hiding this comment

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

자바 초보라 여쭤봐요..
문자열을 더하는 연산이 아닌 subString을 사용하신 이유가 더 효율적이라서 그런가요?

}
}

return dp[s.length()];
Copy link
Contributor

Choose a reason for hiding this comment

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

좋은 풀이 잘 보고 갑니다.

@TonyKim9401 TonyKim9401 merged commit fddf7c3 into DaleStudy:main Jan 12, 2025
3 checks passed
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.

3 participants