Add day 1-5

This commit is contained in:
2024-12-18 23:45:11 -07:00
commit ebd8d45970
61 changed files with 932 additions and 0 deletions
View File
View File
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env python3
filename = "example.txt"
filename = "input.txt"
with open(filename) as f:
data = f.readlines()
l = []
r = []
for line in data:
split = line.split(" ")
l.append(int(split[0]))
r.append(int(split[-1].strip()))
if len(l) != len(r):
raise Exception("lists must be the same length")
total = 0
for e in l:
count = r.count(e)
result = e * count
print(f"count: {count}, result: {result}")
total += result
print("")
print(total)
+6
View File
@@ -0,0 +1,6 @@
3 4
4 3
2 5
1 3
3 9
3 3
+14
View File
@@ -0,0 +1,14 @@
[tool.poetry]
name = "aoc"
version = "0.1.0"
description = ""
authors = ["restitux <restitux@ohea.xyz>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.12"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
View File