diff --git a/2022/day1/1.py b/2022/day1/1.py new file mode 100644 index 0000000..3841ee4 --- /dev/null +++ b/2022/day1/1.py @@ -0,0 +1,14 @@ +lines = [i for i in open("input.txt", 'r').read().splitlines()] + +elves = [] +summa = 0 +for l in lines: + if l == "": + elves.append(summa) + summa = 0 + else: + summa += int(l) + +top3 = sorted(elves)[-3:] +print(top3) +print(sum(top3)) diff --git a/README.md b/README.md index 4538401..b6730b1 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ my solutions for the [Advent of Code](https://adventofcode.com/) in progress:\ 2021 (python) +2022 (python) planned:\ -2022 (swift)\ -2020 (rust?)\ +2020\ 2019\ 2018\ 2017\