Skip to content

Commit b4703f7

Browse files
committed
fix ruffs
1 parent 2226db4 commit b4703f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

project_euler/problem_108/sol1.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def find_prime_factorizations(limit: int) -> list[dict[int, int]]:
4747
[{}, {}, {2: 1}, {3: 1}, {2: 2}, {5: 1}, {2: 1, 3: 1}, {7: 1}]
4848
"""
4949
primes = find_primes(limit)
50-
prime_factorizations = [{} for _ in range(limit + 1)]
50+
prime_factorizations : list[dict[int, int]] = [{} for _ in range(limit + 1)]
5151

5252
for p in primes:
5353
for j in range(p, limit + 1, p):
5454
j_factorization = prime_factorizations[j]
5555
x = j
5656
while x % p == 0:
57-
x /= p
57+
x //= p
5858
j_factorization[p] = j_factorization.get(p, 0) + 1
5959
return prime_factorizations
6060

@@ -86,6 +86,8 @@ def solution(target: int = 1000) -> int:
8686
num_solutions = (num_divisors_of_square(prime_factorizations[i]) // 2) + 1
8787
if num_solutions > target:
8888
return i
89+
90+
return -1
8991

9092

9193
if __name__ == "__main__":

0 commit comments

Comments
 (0)