From 414cbef5491b0f699f345b01aede738aaa98f8c2 Mon Sep 17 00:00:00 2001 From: Sebastian Seedorf Date: Wed, 2 Dec 2020 11:54:25 +0100 Subject: [PATCH] Day 1 (part 2 renaming) --- .idea/misc.xml | 2 +- day01/part2.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 35686ab..7122d66 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/day01/part2.py b/day01/part2.py index bacb945..e32068e 100644 --- a/day01/part2.py +++ b/day01/part2.py @@ -7,8 +7,8 @@ tree = dict() def tree_up(idx, step=1, offset = 0): print(idx, step) - next = tree[(idx, step)] if (idx, step) in tree else None - appendix = [] if next is None else tree_up(next+idx, step=step+1, offset=idx) + nxt = tree[(idx, step)] if (idx, step) in tree else None + appendix = [] if nxt is None else tree_up(nxt+idx, step=step+1, offset=idx) return [idx - offset] + appendix @@ -23,7 +23,7 @@ for item in items: sum(vals), math.prod(vals) )) - exit(0) + exit() elif new[0] < 0 or new[1] < 0: # target value too low or to many sums continue