Skip to content

Commit

Permalink
Merge pull request #47 from kjs254/11-kjs254
Browse files Browse the repository at this point in the history
11-kjs254
  • Loading branch information
tgyuuAn authored Jun 27, 2024
2 parents cd9f01b + a20fb84 commit de9a275
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 23 additions & 0 deletions kjs254/DFS/νƒ€κ²Ÿ λ„˜λ²„.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
def DFS(length, start, path):
if len(path) > length:
return
idxs_list.append(path)

for i in range(start, length):
DFS(length, i + 1, path + [i])

def solution(numbers, target):
global idxs_list
idxs_list = []
DFS(len(numbers),0,[])
my_numbers = [x for x in numbers]
count=0

for idx in idxs_list:
for i in idx:
my_numbers[i] *=-1
if sum(my_numbers)==target:
count+=1
my_numbers = [x for x in numbers]

return count
4 changes: 1 addition & 3 deletions kjs254/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## ✏️ 기둝

| μ°¨μ‹œ | λ‚ μ§œ | λ¬Έμ œμœ ν˜• | 링크 | 풀이 |
|:----:|:---------:|:----:|:-----:|:----:|
| 1μ°¨μ‹œ | 2024.02.12 | μŠ€νƒ | [κΈ°λŠ₯개발](https://school.programmers.co.kr/learn/courses/30/lessons/42586) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/2) |
Expand All @@ -12,4 +10,4 @@
| 8μ°¨μ‹œ | 2024.03.08 | κ΅¬ν˜„ | [νŠœν”Œ](https://school.programmers.co.kr/learn/courses/30/lessons/64065) | [#30](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/30) |
| 9μ°¨μ‹œ | 2024.03.10 | κ΅¬ν˜„ | [λ‰΄μŠ€ ν΄λŸ¬μŠ€ν„°λ§](https://school.programmers.co.kr/learn/courses/30/lessons/17677) | [#33](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/33) |
| 10μ°¨μ‹œ | 2024.04.02 | ν•΄μ‹œ | [μ „ν™”λ²ˆν˜Έ λͺ©λ‘](https://school.programmers.co.kr/learn/courses/30/lessons/42577) | [#46](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/46) |
---
| 11μ°¨μ‹œ | 2024.04.05 | DFS | [νƒ€κ²Ÿ λ„˜λ²„](https://school.programmers.co.kr/learn/courses/30/lessons/43165) | [#47](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/47) |

0 comments on commit de9a275

Please sign in to comment.