-
-
Notifications
You must be signed in to change notification settings - Fork 195
[이유진] 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
[이유진] Week 5 #874
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.
반갑습니다! 5주차 문제 푸시느라 고생 많으셨습니다!
코틀린 처음인데도 코드 작성을 잘 해주셔서 리뷰하는데 큰 도움이 되었습니다 😄
6주차도 같이 파이팅해요!!
아 그리고 괜찮으시다면 시간복잡도, 공간복잡도도 간단하게 작성해보시는 것 추천 드립니다 !
리뷰할 때 아 이렇게 분석하셨구나 하면서 리뷰하는 사람에게도 도움이 많이 되더라구요!
group-anagrams/Real-Reason.kt
Outdated
val chars = str.toCharArray().sorted() | ||
anagrams.putIfAbsent(chars.toString(), mutableListOf()) | ||
val words = anagrams[chars.toString()] |
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.
chars.toString()
이 반복적으로 사용되고 있어서 chars
변수에 바로 string값을 저장하는 것도 괜찮을 것 같아요 ~
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.
코틀린 언어는 처음인데 putIfAbsent
메서드를 지원하나봐요! 조건문 처리할 때 엄청 편할 것 같아요 👍
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.
chars.toString()이 반복적으로 사용되고 있어서 chars 변수에 바로 string값을 저장하는 것도 괜찮을 것 같아요 ~
오, 그렇네요~
리뷰 반영했습니다 :) c5e173a
코틀린 언어는 처음인데 putIfAbsent 메서드를 지원하나봐요! 조건문 처리할 때 엄청 편할 것 같아요 👍
맞습니다~ map 에 대해서 다양한 메서드를 제공하더라구요 :)
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가지 방법 모두 작성하셨군요.
더 나은 로직 고민하시는 부분 멋지십니다 👍
val items = hashMapOf<Char, Document>() | ||
} | ||
|
||
private val document = Document(end = true) |
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.
질문입니다~
document
노드가 루트 노드인데 end
값이 true
로 설정된 이유가 있을까요?!
단어의 끝이 아니라서 여쭈어봐요~~
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.
아, emptyString 이 있을거라고 생각해서 true 로 설정했습니다.!
그런데 다시 문제를 보니 length 가 1 이상이네요 😂
리뷰 감사합니다~ |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.