조합 예시
arr =[1,2,3,4,5,6]
path=['']*3
def abc(level):
if level==3:
for i in range(3):
print(path[i],end='')
print()
return
for i in range(6):
if level>0 and path[level-1] >= arr[i]:
continue
path[level]=arr[i]
abc(level+1)
abc(0)
중복조합 예시
arr =[1,2,3,4,5,6]
path=['']*3
def abc(level):
if level==3:
for i in range(3):
print(path[i],end='')
print()
return
for i in range(6):
if level>0 and path[level-1] > arr[i]:
continue
path[level]=arr[i]
abc(level+1)
abc(0)