Day 15 - foreign input

This commit is contained in:
Stefan Harmuth 2023-12-15 07:34:17 +01:00
parent 7857f25070
commit 8949e72e6d
2 changed files with 5 additions and 2 deletions

View File

@ -39,20 +39,22 @@ class Day(AOCDay):
inputs = [
[
(1320, "input15_test"),
(513214, "input15_dennis"),
(513158, "input15"),
],
[
(145, "input15_test"),
(258826, "input15_dennis"),
(200277, "input15"),
]
]
def part1(self) -> Any:
return sum(HASH(c) for c in self.getInput().split(","))
return sum(HASH(c) for c in self.getInputAsArraySplit(","))
def part2(self) -> Any:
boxes = {}
for s in self.getInput().split(","):
for s in self.getInputAsArraySplit(","):
if '-' in s:
label = s[:-1]
label_hash = HASH(label)

1
inputs/input15_dennis Normal file

File diff suppressed because one or more lines are too long