![](https://velog.velcdn.com/images/y7y1h13/post/dc22d1c4-696f-4b97-b0c6-33d13c2af78d/image.png)
수를 받아서 정렬을 해야한다.
정렬 후 그 수로 백트래킹 실행
N, M = map(int, input().split())
t = list(map(int, input().split()))
t.sort()
a = []
def dfs():
if len(a) == M:
print(' '.join(map(str, a)))
return
for i in range(0, N):
if t[i] not in a:
a.append(t[i])
dfs()
a.pop()
dfs()