-
-
Notifications
You must be signed in to change notification settings - Fork 195
[ackku] Week 5 #882
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
[ackku] Week 5 #882
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.
요번 주도 고생 많으셨습니다~~^^
날씨도 추운데 건강 조심하시고
다음 주도 화이팅입니다~~
@@ -0,0 +1,40 @@ | |||
// 투포인터를 쓸 필요 없음. 그냥 최소값을 찾아 빼주면 O(N)의 시간 복잡도를 얻을 수 있다. | |||
// 투포인터와 큰 차이가 없는 이유는 투포인터도 O(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.
2가지 방식을 모두 생각해보신 것 너무 좋은데요?
저는 풀기에 바빴는데, 배우고 갑니다
// 아이디어로 푸는 문제라 선호하지 않는 문제... | ||
// 그냥 사용하지 않는 것을 구분자로 두고 스플릿하는게 가장 편하다. 아예 나오지 않을 문자를 기준으로 두면 길이를 알 필요가 없기 때문 | ||
public class Solution { | ||
// 인코딩 메서드 |
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.
이건 사소한 건데 Delimeter를 인스턴스 변수로 두고 쓰면 좋을 거 같아요
} | ||
|
||
int length = Integer.parseInt(s.substring(i, j)); | ||
decodedList.add(s.substring(j + 1, j + 1 + length)); |
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.
자바 초보라 여쭤봐요..
문자열을 더하는 연산이 아닌 subString을 사용하신 이유가 더 효율적이라서 그런가요?
} | ||
} | ||
|
||
return dp[s.length()]; |
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.
좋은 풀이 잘 보고 갑니다.
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.