[Java] 프로그래머스 43165번 DFS 타겟 넘버 : 짧은 풀이
·
💡 CodingTest/프로그래머스
[Java] 프로그래머스 43165번 타겟 넘버 DFS 문제 설명 내 코드 🔑 Key Point 🔑 return dfs(numbers,target,index+1, num+numbers[index])+dfs(numbers,target,index+1,num-numbers[index]);} 이부분은 +,-모든 경우의 수를 다 조사해야 되고 그것의 수를 세야 하기 때문에 +로 재귀를 썻다.
슬라임 통통
'타겟넘버' 태그의 글 목록