Open
Conversation
gusah009
reviewed
Mar 14, 2024
Collaborator
gusah009
left a comment
There was a problem hiding this comment.
테스트도 꼼꼼하게 짜여져있고 구현하기 어려웠을 과제인데 로직을 깔끔하게 구현한 것 같습니다~ 수고하셨습니다~ 👍👍
| try { | ||
| return inputFunction() | ||
| } catch (_: IllegalArgumentException) { | ||
| outputManager.printExceptionMessage() |
Comment on lines
+55
to
+61
| fun getEndDateOfMonth(month: Int): Int { | ||
| if (month !in 1..12) { | ||
| throw IllegalArgumentException() | ||
| } | ||
| val daysOfMonth = listOf(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) | ||
| return daysOfMonth[month-1] | ||
| } |
Collaborator
There was a problem hiding this comment.
Month가 1~12 안에 속하는지 input 클래스와 여기 두 곳에서 검증하는 것 같은데, Month data 클래스를 만들어서 가지고 옮겨다니면 내부적으로 daysOfMonth도 가질 수 있어서 코드가 더 깔끔해 질 것 같아요~
| enum class Holiday( | ||
| val month: Int, | ||
| val date: Int, | ||
| val korean: String |
gusah009
approved these changes
Mar 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
허허.. 이번엔 늦었네요 ㅠㅠ
구현 방식을 어떻게 할 지 고민하다가 잘못될 경우마다 스택에 넣을까? 하다가 너무 복잡할 것 같아서 미리 근무자 리스트를 만들고 코틀린 내장 메서드를 최대한 활용해서 구현했습니다! 테스트 코드를 짜긴 했는데.. 이 방식이 맞는지 사실 확신은 못하겠네요ㅠㅠ
저는 평일 근무자와 휴일 근무자를 전체 날짜만큼 순서대로 만들어두고
전체 근무자 리스트의 마지막 사람과 이름이 다른 가장 앞에있는 근무자를 전체 근무자 리스트에 추가하고 평일/휴일 근무자 리스트에서 해당 근무자를 삭제하는 방법을 사용했어요!