일곱난쟁이

itertools.permutations 활용 구현

from itertools import permutations

MAXN = 9

ls = [int(input()) for _ in range(MAXN)]

for perm in permutations(ls, 7):
    if sum(perm) == 100:
        {print(x) for x in sorted(perm)}
        break