파이썬
모든 수의 조합 구하기
메밀국수가생각나
2021. 11. 14. 22:37
from itertools import permutations
문자열이된 숫자 배열 = list(map(str,숫자 배열))
for i in range(1,len(숫자배열)+1):
for permu in permutations(문자열이된 숫자 배열,i):
result.append(''.join(permu))
result = list(map(int,result))
# 중복된 값을 제거하구 싶으면 set을 활용한다.
resultSet = set(result)