-
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
[전현수] - 치즈, 가장 긴 증가하는 부분 수열 4, 내리막 길, 삼각 달팽이 #268
Conversation
Position(1, 0), | ||
Position(0, 1), | ||
Position(-1, -1), |
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.
설명 듣고 나니 풀이가 참 좋았슴다 번거롭게 인덱스 계산 안해도 되구요
for (j in this.first().indices) { | ||
val cur = this[i][j] | ||
if (cur == 1) this[i][j] = 0 | ||
else if (cur == 2) this[i][j] = 3 |
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.
치즈 녹이는 로직이 새로웠어요
Position(1, 0), | ||
Position(0, 1), | ||
Position(-1, -1), |
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.
요렇게 3방향 정해놓고 푸는게 깔끔해보였습니다!!
ny !in board.first().indices | ||
) return@forEach | ||
|
||
if (0 < board[nx][ny]) board[nx][ny]-- |
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.
이렇게 체크하는 것도 괜찮네요!!
ny !in board.first().indices | ||
) return@forEach | ||
|
||
if (0 < board[nx][ny]) board[nx][ny]-- |
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.
3으로 쌓아두고 하나씩 빼는 방식도 좋네요!
📌 from issue #266 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모
공유하고 싶은 정보, 새롭게 알게된 것, 문제를 풀면서 발생한 에로사항 등...자유롭게!