Initial commit: AoC solutions 2023-2025

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Samuel Enocsson
2025-12-02 10:39:09 +01:00
commit 549f0c4382
90 changed files with 17360 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import re
def main():
with open("6-input.txt", 'r') as file:
winning_distances = []
lines = file.readlines()
time = ''.join(re.findall('\d+', lines[0]))
distance = ''.join(re.findall('\d+', lines[1]))
result = calcualte_distance(int(time), int(distance))
winning_distances.append(len(result))
winning_totals = 1
for value in winning_distances:
winning_totals *= value
print(winning_totals)
def calcualte_distance(time: int, distance: int):
reaches_longer = []
for i in range(0, time):
d = i * (time - i)
if d > distance:
reaches_longer.append(d)
return reaches_longer
if __name__ == "__main__":
main()