commit 46b195249c9d66d42f069d54247245e81593fb41 Author: setop Date: Fri Dec 1 12:26:16 2023 +0100 day 1, one unclear rule prolonged part 2 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