Created
December 1, 2022 13:24
-
-
Save alyssadev/a889492e92b14a76f3ab015250828dde to your computer and use it in GitHub Desktop.
aoc 2022
This file contains hidden or 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
with open("aoc1.txt") as f: | |
data = f.read().strip() | |
elves = [list(map(int,_.split("\n"))) for _ in data.split("\n\n")] | |
ans1 = max(sum(_) for _ in elves) | |
ans2 = sum(sorted(sum(_) for _ in elves)[-3:]) | |
print(ans1,ans2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment