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

11-kjs254 #47

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) |