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

[Week5] 강동호: 전쟁 - 전투, 촌수계산, 섬의 개수, 바이러스, 타겟 넘버 #22

Merged
merged 7 commits into from
Jun 18, 2022

Conversation

gongdongho12
Copy link
Member

📒 Issue Number

linked issue #18


💎 문제 해결

전투: ⭕️
촌수계산: ⭕️
섬의 개수: ⭕️
바이러스: ⭕️
타겟 넘버: ⭕️

🔥 특이사항/질문

타겟 넘어 타인 풀이인데 https://programmers.co.kr/learn/courses/30/lessons/43165/solution_groups?language=kotlin

class Solution {
        fun solution(numbers: IntArray, target: Int): Int {
        return numbers.fold(listOf(0)) { list, i ->
            list.run {
                map { it + i } + map { it - i }
            }
        }.count { it == target }
    }
}

이렇게도 재귀를 만들어낼 수 있구나 하는 생각이 들었습니다
좋은 문제 제공해주신 재원님 감사합니다!

@gongdongho12 gongdongho12 merged commit f3dd67e into main Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant