Skip to content

Commit 581c44d

Browse files
committed
Fix flake8 errors
1 parent 8adb7c1 commit 581c44d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

project_euler/problem_49/sol1.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from itertools import permutations
2+
from math import floor, sqrt
3+
14
"""
25
Prime permutations
36
@@ -26,9 +29,6 @@
2629
3 nested loops since we know the answer will be 12 digits.
2730
"""
2831

29-
from itertools import permutations
30-
from math import floor, sqrt
31-
3232

3333
def is_prime(number: int) -> bool:
3434
"""
@@ -60,15 +60,15 @@ def search(target: int, prime_list: list) -> bool:
6060
False
6161
"""
6262

63-
l, r = 0, len(prime_list) - 1
64-
while l <= r:
65-
m = (l + r) // 2
63+
left, right = 0, len(prime_list) - 1
64+
while left <= right:
65+
m = (left + right) // 2
6666
if prime_list[m] == target:
6767
return True
6868
elif prime_list[m] < target:
69-
l = m + 1
69+
left = m + 1
7070
else:
71-
r = m - 1
71+
right = m - 1
7272

7373
return False
7474

project_euler/problem_50/sol1.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from math import floor, sqrt
2+
13
"""
24
Consecutive prime sum
35
@@ -25,8 +27,6 @@
2527
Then, use sliding window to get the answer.
2628
"""
2729

28-
from math import floor, sqrt
29-
3030

3131
def is_prime(number: int) -> bool:
3232
"""

0 commit comments

Comments
 (0)