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

[장희직] - 민겸 수, 이모티콘 할인 행사 #209

Merged
merged 7 commits into from
Feb 25, 2024
Merged

Conversation

jhg3410
Copy link
Member

@jhg3410 jhg3410 commented Feb 25, 2024

📌 from issue #206 📌

📋문제 목록📋

민겸 수: ✅
이모티콘 할인 행사: ✅

📍추가로 해결한 문제📍

@jhg3410 jhg3410 self-assigned this Feb 25, 2024
@jhg3410 jhg3410 added the 희직 label Feb 25, 2024
}
}

private fun String.getMaxDecimal(): String {
Copy link
Contributor

Choose a reason for hiding this comment

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

확장함수 오랜만에 보네요,,,

Comment on lines +27 to +29
discounts.add(discountRate)
findDiscounts(discounts = discounts, counts = counts)
discounts.removeLast()
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 해주면 매번 배열을 새로 만들지 않아도 되는군요!

}
}

private fun String.getMaxDecimal(): String {
Copy link
Member

Choose a reason for hiding this comment

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

확장함수가 예쁘네용


private fun findDiscounts(discounts: MutableList<Int>, counts: Int) {
if (discounts.size == counts) {
getResult(discounts).run {
Copy link
Member

Choose a reason for hiding this comment

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

여기서 결과를 계산해서 discounts를 복사할 필요가 없었군요!

@jhg3410 jhg3410 merged commit dab07e0 into main Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants