Skip to content

Commit b20104e

Browse files
committed
completed solution
1 parent 2452318 commit b20104e

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

‎CodeWars/6kyu/steps_in_primes.py‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,8 @@ def is_prime(num):
88
return False
99
return True
1010

11-
def step(g, m, n):
12-
primes = []
13-
14-
for i in range(m, n):
15-
if is_prime(i):
16-
print(i)
17-
primes.append(i)
18-
19-
for i in range(len(primes)):
20-
num = primes[i]
21-
for p in primes[i::]:
22-
if p - num == g:
23-
return [num, p]
24-
elif p - num > g:
25-
break
26-
11+
def step(g,m,n):
12+
for i in range(m,n-g):
13+
if is_prime(i) and is_prime(i+g):
14+
return[i, i+g]
2715
return None

0 commit comments

Comments
 (0)