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

[Week3] 안찬우 : 킹, 랜선 자르기, 크로스워드, 단풍잎이야기 #16

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

ChanwooAn
Copy link
Contributor

Issue Number

Issue #12

💎 문제 해결
: ⭕️
랜선 자르기: ⭕️
크로스워드: ⭕️
단풍잎 이야기: ⭕️
도피: ❌

🔥 특이사항/질문

도피는... dp table을 어떤식으로 renew할지 떠오르지가 않네요... dp는 항상 풀때마다 느끼지만 제가 바보가 되는것만 같습니다 ㅠㅠ

@ChanwooAn ChanwooAn self-assigned this Oct 17, 2022
Copy link
Member

@gongdongho12 gongdongho12 left a comment

Choose a reason for hiding this comment

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

리뷰 늦어서 죄송합니다 🙇

src/3week/acw/단풍잎이야기.kt Show resolved Hide resolved
src/3week/acw/단풍잎이야기.kt Outdated Show resolved Hide resolved
Comment on lines 28 to 40
fun countQuests(arr:List<Int>):Int{
var count=0
loop1@for(i in quests){
for(j in i){
if(!arr.contains(j)) {
continue@loop1
}
}

count++
}
return count
}
Copy link
Member

Choose a reason for hiding this comment

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

이 함수 따로 뺴지 않고 아래와 같이 대체될 수 있을것 같아요

quests.sumOf { quest -> quest.count { q -> arr.contains(q) } }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

훨씬 깔끔하고 좋아보입니다. 그런데 만약에 위와 같이 함수로 빼는게 코드량은 늘지만 가독성면에 있어서는 훨씬 좋다면 어떤것을 선택하는게 좋을까요? (물론 위의 함수는 그리 가독성도 좋아보이지는 않습니다만... 만약을 가정하면요 ㅎㅎ...)
늦게 질문드려서 죄송합니다.

Copy link
Member

Choose a reason for hiding this comment

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

가독성 좋은 쪽을 택하는게 맞습니다
사실 애초에 속도 빠른 코드를 짜기위해서 시스템 코딩을 해야하는 경우엔 Go나 Rust로 짜겠지만 저희는 여러 사람이 함께 작업하는 코드를 만들어가는게 중요하니까요 :)

src/3week/acw/단풍잎이야기.kt Show resolved Hide resolved
src/3week/acw/랜선자르기.kt Outdated Show resolved Hide resolved
src/3week/acw/킹.kt Show resolved Hide resolved
src/3week/acw/크로스워드.kt Show resolved Hide resolved
src/3week/acw/킹.kt Show resolved Hide resolved
src/3week/acw/킹.kt Show resolved Hide resolved



println("${(kingX+'A'.toInt()).toChar()}${8-kingY}\n${(stoneX+'A'.toInt()).toChar()}${8-stoneY}")
Copy link
Member

Choose a reason for hiding this comment

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

출력에 개행 포함해서 out 연산이 한번인건 좋아요!
이부분도 toString 오버라이딩 해서 king과 stone 출력하는 함수 만들면 king따로 출력연산 구성하고 stone따로 연산 구성할 필요없이 "$king\n$stone" 으로 출력이 끝나겠죠?
[참고 - 현수님 리뷰]

@gongdongho12 gongdongho12 added the review complete 리뷰 완료 label Oct 23, 2022
@gongdongho12 gongdongho12 linked an issue Oct 23, 2022 that may be closed by this pull request
@ChanwooAn ChanwooAn merged commit 7269762 into main Nov 8, 2022
@ashwon12 ashwon12 deleted the week3_acw branch November 18, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review complete 리뷰 완료
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[3주차 문제]
2 participants