First day

This commit is contained in:
Rasmus Malver 2022-12-01 16:14:24 +01:00
parent bdf7896fa7
commit ebe05d0bcd
4 changed files with 2281 additions and 1 deletions

8
2022-12-01-A.py Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env python3
with open("2022-12-01-input.txt", "r") as f:
elves = [x.split("\n") for x in f.read().split("\n\n")]
ints = [[int(j) for j in i] for i in elves]
sums = sorted([sum(i) for i in ints])
print(sums[-1])

8
2022-12-01-B.py Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env python3
with open("2022-12-01-input.txt", "r") as f:
elves = [x.split("\n") for x in f.read().split("\n\n")]
ints = [[int(j) for j in i] for i in elves]
sums = sorted([sum(i) for i in ints])
print(sum(sums[-3:]))

2264
2022-12-01-input.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,3 @@
# aoc2022 # aoc2022
Advent of code 2022 My solutions for the [Advent of Code 2022](https://adventofcode.com/).