from itertools import permutations def solution(numbers): a = set() for i in range(len(numbers)): a |= set(map(int, map("".join, permutations(list(numbers), i + 1))))
a의 값 {1, 71, 17, 7}