」 feat(day5): i hate part2 :smadge:

This commit is contained in:
y-syo
2025-12-05 17:28:17 +01:00
parent 338a76a552
commit 700e40b5e3
2 changed files with 78 additions and 0 deletions

27
2025/05/part1.py Normal file
View File

@@ -0,0 +1,27 @@
import os
if (os.path.isfile("./input")):
input = open("./input", "r").read()
else:
input = "3-5\n10-14\n16-20\n12-18\n\n1\n5\n8\n11\n17\n32\n"
input = input[:-1]
isList = True
fresh = []
c = 0
for line in input.split('\n'):
if (line == ""):
isList = False
continue
if (isList):
fresh.append([int(line.split('-')[0]), int(line.split('-')[1])])
if (not isList):
for f in fresh:
if (int(line) >= f[0] and int(line) <= f[1]):
c += 1
break
print(c)