mirror of
https://github.com/Xevion/advent-of-code.git
synced 2026-01-31 04:23:24 -06:00
day 8 minor day 9 setup
This commit is contained in:
@@ -14,7 +14,7 @@ class Node(object):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
curadd = 0
|
curadd = 0
|
||||||
for i in range(self.childnum):
|
for _ in range(self.childnum):
|
||||||
self.children.append(
|
self.children.append(
|
||||||
Node(self.input, self.root + 2 + curadd)
|
Node(self.input, self.root + 2 + curadd)
|
||||||
)
|
)
|
||||||
@@ -36,7 +36,7 @@ class Node(object):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'Node at index {self.root}'
|
return f'Node at index {self.root}'
|
||||||
|
|
||||||
# Part 2
|
# Part 2 Solution Function
|
||||||
def getValue(self):
|
def getValue(self):
|
||||||
if self.childnum == 0:
|
if self.childnum == 0:
|
||||||
return sum(self.entries)
|
return sum(self.entries)
|
||||||
|
|||||||
Reference in New Issue
Block a user