Skip to content

Instantly share code, notes, and snippets.

@albertein
Last active December 1, 2022 17:25
Show Gist options
  • Save albertein/4cb87ece69919b87b8a3a02112cdbcc2 to your computer and use it in GitHub Desktop.
Save albertein/4cb87ece69919b87b8a3a02112cdbcc2 to your computer and use it in GitHub Desktop.
elves = []
current_elf = 0
with open('input.txt', encoding="utf-8") as file:
for line in file.readlines():
line = line.strip()
if line == '':
elves.append(current_elf)
current_elf = 0
continue
current_elf += int(line)
elves.append(current_elf)
print(max(elves))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment