Files
AoC/2022/Day-01/day01-1.py
2022-12-03 12:44:18 +00:00

17 lines
382 B
Python

#!/usr/bin/python3
total = 0
elves = []
# Add each line of the input, when we hit a blank line put the current total in a list.
with open('input.txt', 'r') as inputFile:
for line in inputFile:
if line == '\n':
elves.append(total)
total = 0
else:
total += int(line)
# Print the largest number in the list.
print(max(elves))