diff options
author | dzwdz | 2022-12-01 20:19:35 +0100 |
---|---|---|
committer | dzwdz | 2022-12-01 20:19:35 +0100 |
commit | dbc42a5a231f3ffd18af571d8b358735a1f831f1 (patch) | |
tree | be7cd6abd715801b5d5a1ad3344254773f632b13 | |
parent | b2503f5ebed4da42950b8e02cb03e0b9950560e9 (diff) |
day 1 in python
demoing some stuff for a friend
-rw-r--r-- | 22.1/main.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/22.1/main.py b/22.1/main.py new file mode 100644 index 0000000..26a7727 --- /dev/null +++ b/22.1/main.py @@ -0,0 +1,14 @@ +from sys import stdin + +best = [] +done = False +while not done: + done = True + total = 0 + for line in stdin: + done = False + line = line.strip() + if line == "": break + total += int(line) + best = sorted([total] + best)[-3:] +print(best[-1], sum(best)) |