Skip to content
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

[정현준] 2주차 답안 제출 #347

Merged
merged 3 commits into from
Aug 22, 2024
Merged

[정현준] 2주차 답안 제출 #347

merged 3 commits into from
Aug 22, 2024

Conversation

* preorder : 현재(부모) 노드부터 왼쪽 자식 노드, 오른쪽 자식 노드
* inorder : 왼쪽 자식 노드 부터 부모 노드, 오른쪽 자식 노드
*/
fun buildTree(preorder: IntArray, inorder: IntArray): TreeNode? {
Copy link
Contributor

Choose a reason for hiding this comment

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

안녕하세요 현준님
이 문제에 대해서도 Big-O analysis를 추가해주시면 좋을 것 같습니다 :D

return dp
}

// 3. 최하위 비트를 제거한 결과를 재활용한다. (최하위 비트를 제거한 결과) + (현재 십진수의 최하위비트)
Copy link
Contributor

Choose a reason for hiding this comment

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

이 방법 너무 좋은 것 같습니다 :D

}

/**
* 4. 배열을 사용하지 않고 DP 적용
Copy link
Contributor

Choose a reason for hiding this comment

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

이 풀이도 정말 좋네요
memoisation 배열의 모든 값이 필요하지 않다는 점을 잘 캐치하신 것 같습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

대부분 달래님 해설로 풀었습니다 ㅎㅎ

Copy link
Contributor

Choose a reason for hiding this comment

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

알고달레 중독자 발견! 💉

@obzva obzva mentioned this pull request Aug 20, 2024
5 tasks
encode-and-decode-strings/jdalma.kt Outdated Show resolved Hide resolved
Comment on lines +30 to +38
@Test
fun `문자열 목록을 하나의 문자열로 인코딩한다`() {
encode(listOf("leet","co:de","l:o:v:e","you")) shouldBeEqual "4:leet5:co:de7:l:o:v:e3:you"
}

@Test
fun `문자열을 문자열 목록으로 디코딩한다`() {
decode("4:leet5:co:de7:l:o:v:e3:you") shouldBeEqual listOf("leet","co:de","l:o:v:e","you")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

테스트 케이스가 아주 적절하네요! 💯

jdalma and others added 2 commits August 21, 2024 15:28
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

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

image

@jdalma jdalma merged commit ac59579 into DaleStudy:main Aug 22, 2024
2 checks passed
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.

3 participants