From 46b195249c9d66d42f069d54247245e81593fb41 Mon Sep 17 00:00:00 2001 From: setop Date: Fri, 1 Dec 2023 12:26:16 +0100 Subject: [PATCH] day 1, one unclear rule prolonged part 2 --- d01/run.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 d01/run.py diff --git a/d01/run.py b/d01/run.py new file mode 100644 index 0000000..63a0022 --- /dev/null +++ b/d01/run.py @@ -0,0 +1,22 @@ +import sys + +D = [str(i) for i in range(1,10)] +if sys.argv[1] == "2": + D += ['one','two','three','four','five','six','seven','eight','nine'] + +def process_line(l): + k = list() + p = 0 + while (p0 else 0 + +R=0 +for l in sys.stdin.readlines(): + n = process_line(l[:-1]) + R+=n[1] +print(R) \ No newline at end of file