Skip to content

[이유진] Week 5 #874

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

Merged
merged 4 commits into from
Jan 11, 2025
Merged

[이유진] Week 5 #874

merged 4 commits into from
Jan 11, 2025

Conversation

Real-Reason
Copy link
Contributor

답안 제출 문제

체크 리스트

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

@Real-Reason Real-Reason self-assigned this Jan 9, 2025
@Real-Reason Real-Reason requested a review from a team as a code owner January 9, 2025 14:33
@github-actions github-actions bot added the kotlin label Jan 9, 2025
@Real-Reason Real-Reason requested a review from mmyeon January 9, 2025 14:34
Copy link
Contributor

@mmyeon mmyeon left a comment

Choose a reason for hiding this comment

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

반갑습니다! 5주차 문제 푸시느라 고생 많으셨습니다!
코틀린 처음인데도 코드 작성을 잘 해주셔서 리뷰하는데 큰 도움이 되었습니다 😄
6주차도 같이 파이팅해요!!

아 그리고 괜찮으시다면 시간복잡도, 공간복잡도도 간단하게 작성해보시는 것 추천 드립니다 !
리뷰할 때 아 이렇게 분석하셨구나 하면서 리뷰하는 사람에게도 도움이 많이 되더라구요!

Comment on lines 6 to 8
val chars = str.toCharArray().sorted()
anagrams.putIfAbsent(chars.toString(), mutableListOf())
val words = anagrams[chars.toString()]
Copy link
Contributor

Choose a reason for hiding this comment

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

chars.toString()이 반복적으로 사용되고 있어서 chars 변수에 바로 string값을 저장하는 것도 괜찮을 것 같아요 ~

Copy link
Contributor

Choose a reason for hiding this comment

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

코틀린 언어는 처음인데 putIfAbsent 메서드를 지원하나봐요! 조건문 처리할 때 엄청 편할 것 같아요 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

chars.toString()이 반복적으로 사용되고 있어서 chars 변수에 바로 string값을 저장하는 것도 괜찮을 것 같아요 ~

오, 그렇네요~
리뷰 반영했습니다 :) c5e173a

코틀린 언어는 처음인데 putIfAbsent 메서드를 지원하나봐요! 조건문 처리할 때 엄청 편할 것 같아요 👍

맞습니다~ map 에 대해서 다양한 메서드를 제공하더라구요 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

2가지 방법 모두 작성하셨군요.
더 나은 로직 고민하시는 부분 멋지십니다 👍

val items = hashMapOf<Char, Document>()
}

private val document = Document(end = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

질문입니다~
document 노드가 루트 노드인데 end값이 true로 설정된 이유가 있을까요?!
단어의 끝이 아니라서 여쭈어봐요~~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아, emptyString 이 있을거라고 생각해서 true 로 설정했습니다.!
그런데 다시 문제를 보니 length 가 1 이상이네요 😂

@Real-Reason
Copy link
Contributor Author

반갑습니다! 5주차 문제 푸시느라 고생 많으셨습니다! 코틀린 처음인데도 코드 작성을 잘 해주셔서 리뷰하는데 큰 도움이 되었습니다 😄 6주차도 같이 파이팅해요!!

아 그리고 괜찮으시다면 시간복잡도, 공간복잡도도 간단하게 작성해보시는 것 추천 드립니다 ! 리뷰할 때 아 이렇게 분석하셨구나 하면서 리뷰하는 사람에게도 도움이 많이 되더라구요!

리뷰 감사합니다~
안그래도 시간복잡도, 공간복잡도 계산하는 방법을 배우면 좋을 것 같더라구요 :) 다음주부터 작성해보겠습니다 💪🏻
6주차도 화이팅입니다!!

@Real-Reason Real-Reason merged commit 5ef7b5d into DaleStudy:main Jan 11, 2025
1 check 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.

2 participants