Skip to content

Commit f2dbda0

Browse files
author
Mallory Brickerd
committed
fix: unnecessary else after return statement
1 parent f07f1e2 commit f2dbda0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

_2025/solutions/day02.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@ def has_repeated_sequence(self, n: int, num_repeats: int | None = None) -> bool:
3939
size = length // num_repeats
4040
return s == s[:size] * num_repeats
4141

42-
else: # Check for any number of repetitions > 1
43-
for k in range(2, length + 1):
44-
if length % k == 0:
45-
size = length // k
46-
if s == s[:size] * k:
47-
return True
42+
for k in range(2, length + 1):
43+
if length % k == 0:
44+
size = length // k
45+
if s == s[:size] * k:
46+
return True
4847

49-
return False
48+
return False
5049

5150
def solve_part(self, data: list[str], func: Callable) -> int:
52-
"""Calculates the sum of numbers in ranges that satisfy the check_func."""
5351
invalid = 0
5452
for line in data[0].split(","):
5553
start, end = map(int, line.split("-"))

0 commit comments

Comments
 (0)