1. 문제
2. 접근 방법
조합입니다요
3. 코드
python
def find(start, cnt):
global answer, nums, n
if cnt == 6:
print(*answer, sep=" ")
return
for i in range(start, n):
answer.append(nums[i])
find(i+1, cnt+1)
answer.pop()
while True:
inputs = list(map(int, input().split()))
if inputs == [0]:
break
else:
n, nums = inputs[0], inputs[1:]
answer = []
find(0, 0)
print()
4. 마치며
마치며~!
'Algorithm > Python' 카테고리의 다른 글
[프로그래머스] 주식가격 (0) | 2021.05.20 |
---|---|
[프로그래머스] 튜플 (0) | 2021.05.14 |
[백준 10974] 모든 순열 (0) | 2021.05.10 |
[백준 10973] 이전 순열 (0) | 2021.05.09 |
[백준 13913] 숨바꼭질 4 (0) | 2021.05.06 |