Skip to content

Commit 475a907

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7c8138e commit 475a907

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

project_euler/problem_095/sol1.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,15 @@ def multiply(
9797
number_n = p * number
9898
if number_n > max_num:
9999
break
100-
multiply(chain=chain, primes=primes, prime=p, prev_n=num, max_num=max_num, prev_sum=new_sum, primes_degrees=primes_degrees.copy())
100+
multiply(
101+
chain=chain,
102+
primes=primes,
103+
prime=p,
104+
prev_n=num,
105+
max_num=max_num,
106+
prev_sum=new_sum,
107+
primes_degrees=primes_degrees.copy(),
108+
)
101109

102110

103111
def find_longest_chain(chain: list[int], max_num: int) -> int:
@@ -143,7 +151,15 @@ def solution(max_num: int = 1000000) -> int:
143151
if prime**2 > max_num:
144152
break
145153

146-
multiply(chain=chain, primes=primes, prime=prime, prev_n=1, max_num=max_num, prev_sum=0, primes_degrees={})
154+
multiply(
155+
chain=chain,
156+
primes=primes,
157+
prime=prime,
158+
prev_n=1,
159+
max_num=max_num,
160+
prev_sum=0,
161+
primes_degrees={},
162+
)
147163

148164
return find_longest_chain(chain, max_num)
149165

0 commit comments

Comments
 (0)