Skip to content

Commit c5bdabc

Browse files
author
Victorio Nascimento
committed
Cleaning
1 parent 31b0567 commit c5bdabc

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

aoc/2025/05/05.vn.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,24 @@
2121
)
2222
)
2323

24-
res1 = 0
25-
for ingredient in ingredients:
26-
for l, r in ranges:
27-
if l <= ingredient and ingredient <= r:
28-
res1 += 1
29-
break
30-
31-
3224
ranges = sorted(ranges)
3325
for i in range(len(ranges) -1):
3426
l, r = ranges[i]
3527
l1, r1 = ranges[i + 1]
3628
if r >= l1:
3729
ranges[i + 1] = (l, max(r, r1))
3830
ranges[i] = (0, -1)
39-
# I should remove them but saying nothing
40-
# is in is enough
41-
31+
# I should remove it but saying
32+
# it is empty is enough
33+
4234
# They're all independant now
35+
36+
res1 = 0
37+
for ingredient in ingredients:
38+
for l, r in ranges:
39+
if l <= ingredient and ingredient <= r:
40+
res1 += 1
41+
4342
res2 = 0
4443
for l, r in ranges:
4544
res2 += r - l + 1

0 commit comments

Comments
 (0)