We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0655338 commit 405e74bCopy full SHA for 405e74b
1 file changed
_2025/solutions/day05.py
@@ -118,15 +118,15 @@ def part2(self, data: str) -> int:
118
ranges, _ = self.parse_data(data)
119
ranges = sorted(ranges, key=lambda interval: interval[0])
120
121
- total = 0
+ count = 0
122
current_start, current_end = ranges[0]
123
124
for start, end in ranges[1:]:
125
if start <= current_end + 1:
126
current_end = max(current_end, end)
127
else:
128
- total += current_end - current_start + 1
+ count += current_end - current_start + 1
129
current_start, current_end = start, end
130
131
132
- return total
+ return count
0 commit comments