Last active
December 1, 2022 17:25
-
-
Save albertein/4cb87ece69919b87b8a3a02112cdbcc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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