Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
프로그래머스 lv.2 타겟 넘버를 풀어봤습니다.
문제 포인트
배열의 각 숫자에 더하기(+)/빼기(-) 부호를 붙여 최종 합계를 만드는 모든 경우의 수를 찾는 문제
재귀 호출 시 현재 인덱스가 배열의 마지막 인덱스를 넘어섰을 때 탐색을 종료
누적 합계가 타겟 넘버와 일치하는지 확인하고, 일치하면 정답 카운트를 1 증가
현재 인덱스의 숫자에 대해 두 가지 선택을 모두 시도하고 재귀 호출