Better cleanup I hope
This commit is contained in:
parent
cb9eec8464
commit
13e9818d08
8
01/2022-12-01-A.py
Normal file
8
01/2022-12-01-A.py
Normal 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
01/2022-12-01-B.py
Normal file
8
01/2022-12-01-B.py
Normal 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
01/2022-12-01-input.txt
Normal file
2264
01/2022-12-01-input.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue