2022 day 1

This commit is contained in:
2022-12-01 17:18:01 +00:00
parent e0dabfc0a1
commit 2c9c2248ab
4 changed files with 2306 additions and 0 deletions

23
2022/01/part1 Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env python
elves = []
with open('input') as f:
elf = []
for line in f:
if line == "\n":
elves.append(elf)
elf = []
else:
calories = int(line)
elf.append(calories)
most = 0
for elf in elves:
calories = sum(elf)
if calories > most:
most = calories
print(most)