-
Notifications
You must be signed in to change notification settings - Fork 0
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
[전현수] - 알고스팟, A와 B 2, 입국심사, 회장뽑기 #186
Conversation
find(s, t.substring(0, t.lastIndex)) | ||
} | ||
if (t.first() == 'B') { | ||
find(s, t.substring(1, t.lastIndex + 1).reversed()) |
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.
재귀함수 깔끔하게 구성하셨네요👍
private data class Position(val x: Int, val y: Int) | ||
|
||
private data class Bundle(val pos: Position, val cost: Int) { | ||
constructor(x: Int, y: Int, cost: Int) : this(Position(x, y), cost) |
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.
오....! 유용해보이네요 코틀린 생성자도 다 까먹고 있었는데 복습해야겠어요
private fun Queue<Pair<Int, Int>>.addAll( | ||
pairElement: Pair<MutableList<Int>, Int>, | ||
) { | ||
pairElement.first.forEach { | ||
this.add(it to pairElement.second) | ||
} | ||
} |
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.
코틀린 활용을 참 잘하시네용 👍
전 다 까묵게 생겼어요...
val visited = BooleanArray(peopleCnt + 1).apply { | ||
this[0] = true | ||
this[myIndex] = 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.
오 깔끔해요
private fun Queue<Pair<Int, Int>>.addAll( | ||
pairElement: Pair<MutableList<Int>, Int>, | ||
) { | ||
pairElement.first.forEach { | ||
this.add(it to pairElement.second) | ||
} | ||
} |
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.
친구관계 넣는 걸 깔끔하게 함수로 빼신 게 좋슴다!
📌 from issue #185 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모
공유하고 싶은 정보, 새롭게 알게된 것, 문제를 풀면서 발생한 에로사항 등...자유롭게!