Day 1 (part 2 renaming)

This commit is contained in:
Sebastian Seedorf
2020-12-02 11:54:25 +01:00
parent a6645ee697
commit 414cbef549
2 changed files with 4 additions and 4 deletions

View File

@@ -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