

n,m = map(int,input().split())
num = list(map(int,input().split()))
num.sort()
li = []
def bt():
if len(li) == m:
print(*li)
return
for i in num:
if i not in li:
li.append(i)
bt()
li.pop()
bt()
for문을 num으로 돌려주었고
기본 구조는 3번 문제와 비슷하다
| [파이썬/python] 백준 1904번 : 01타일 (🥈3) (0) | 2023.06.30 |
|---|---|
| [파이썬/python] 백준 15655번 : N과 M (6) (🥈3) (0) | 2023.06.14 |
| [파이썬/python] 백준 10824번 : 네 수 (🥉3) (1) | 2023.06.13 |
| [파이썬/python] 백준 1259번 : 팰린드롬수 (🥉1) (0) | 2023.06.12 |
| [파이썬/python] 백준 15652번 : N과 M (4) (🥈3) (0) | 2023.06.11 |