2022 - Day 1 part 1
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kleph 2022-12-01 10:34:34 +01:00
parent 9598e8f526
commit 940d738c4f
3 changed files with 2289 additions and 0 deletions

20
2022/1/1.py Normal file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env python
# 2022 - Advent Of Code 1
# file = 'input_example.txt'
file = 'input.txt'
calories = []
with open(file, encoding="utf-8") as f:
accum = 0
for line in f.readlines():
if line == '\n':
# next elf
calories.append(accum)
accum = 0
else:
accum += int(line)
calories.append(accum)
print(calories)
print(max(calories))

2255
2022/1/input.txt Normal file

File diff suppressed because it is too large Load diff

14
2022/1/input_example.txt Normal file
View file

@ -0,0 +1,14 @@
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000