# 소수 찾기 - 프로그래머스
from itertools import permutations
def prime(n):
if n < 2:
return False
if n == 2:
return True
if n % 2 == 0:
return False
for i in range(3, round(n**0.5) + 1, 2):
if n % i == 0:
return False
return True
def solution(numbers):
cnt = 0
ret = []
for i in range(1, len(numbers) + 1):
for each_tuple in list(set(permutations(numbers, i))):
ret.append(int(''.join(each_tuple)))
for i in list(set(ret)):
if prime(i) == True:
cnt += 1
return cnt