We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cb98e7 commit c7cf223Copy full SHA for c7cf223
1 file changed
live12/test126/문제1/백한결.py
@@ -0,0 +1,27 @@
1
+from itertools import permutations
2
+
3
4
+def solution(numbers):
5
+ numberSet = set()
6
7
+ for i in range(1, len(numbers) + 1):
8
+ for p in permutations(numbers, i):
9
+ num = int(''.join(p))
10
+ numberSet.add(num)
11
12
+ count = 0
13
14
+ for num in numberSet:
15
+ if num < 2:
16
+ continue
17
+ isPrime = True
18
19
+ for i in range(2, int(num ** 0.5) + 1):
20
+ if num % i == 0:
21
+ isPrime = False
22
+ break
23
24
+ if isPrime:
25
+ count += 1
26
27
+ return count
0 commit comments