diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-17 14:13:15 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-17 14:14:38 +0100 |
commit | 480c0f61b440c7db047de512c37b3238fad0f672 (patch) | |
tree | f868219e0eece7cf529feda701360ee6536bbb09 | |
parent | d3ed2f503e58c604bb85dc3487fda3d1191313b4 (diff) | |
download | advent-of-code-480c0f61b440c7db047de512c37b3238fad0f672.tar.gz advent-of-code-480c0f61b440c7db047de512c37b3238fad0f672.tar.bz2 advent-of-code-480c0f61b440c7db047de512c37b3238fad0f672.zip |
Made a python version of puzzle 1
I'm going to use a different language per puzzle now.
-rw-r--r-- | 2022/puzzle-1.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/2022/puzzle-1.py b/2022/puzzle-1.py new file mode 100644 index 0000000..19ccfe2 --- /dev/null +++ b/2022/puzzle-1.py @@ -0,0 +1,8 @@ +inp = None +with open('1-input', 'r') as fp: + inp = fp.read() +sums = sorted([sum([int(entity) for entity in entity_str.split("\n") if entity != '']) for entity_str in inp.split("\n\n")]) +print(f"round 1: {sums[-1]}") +print(f"round 2: {sums[-1]} {sums[-2]}, {sums[-3]}, {sum(sums[-3:])}") + + |