We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
package main.java.com.poogle.PG.Q43165; public class Solution { static int answer, target; static int[] numbers; public static void main(String[] args) { System.out.println(solution(new int[]{1, 1, 1, 1, 1}, 3)); } public static int solution(int[] numbers, int target) { answer = 0; Solution.target = target; Solution.numbers = numbers; dfs(0, 0); return answer; } private static void dfs(int sum, int i) { //1. 탈출 조건 if (numbers.length == i) { if (target == sum) answer++; return; } //2. 실행 동작 dfs(sum + numbers[i], i + 1); dfs(sum - numbers[i], i + 1); } }
The text was updated successfully, but these errors were encountered:
eed7bac
PG: 43165 더 쉬운 풀이로 수정
f5d45da
Issue #121
suhyunsim
No branches or pull requests
문제
핵심 아이디어
어려운 점, 실수
풀이
The text was updated successfully, but these errors were encountered: