generated from public/aoc_template
Day 15 - foreign input
This commit is contained in:
parent
7857f25070
commit
8949e72e6d
6
day15.py
6
day15.py
@ -39,20 +39,22 @@ class Day(AOCDay):
|
|||||||
inputs = [
|
inputs = [
|
||||||
[
|
[
|
||||||
(1320, "input15_test"),
|
(1320, "input15_test"),
|
||||||
|
(513214, "input15_dennis"),
|
||||||
(513158, "input15"),
|
(513158, "input15"),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
(145, "input15_test"),
|
(145, "input15_test"),
|
||||||
|
(258826, "input15_dennis"),
|
||||||
(200277, "input15"),
|
(200277, "input15"),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
def part1(self) -> Any:
|
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:
|
def part2(self) -> Any:
|
||||||
boxes = {}
|
boxes = {}
|
||||||
for s in self.getInput().split(","):
|
for s in self.getInputAsArraySplit(","):
|
||||||
if '-' in s:
|
if '-' in s:
|
||||||
label = s[:-1]
|
label = s[:-1]
|
||||||
label_hash = HASH(label)
|
label_hash = HASH(label)
|
||||||
|
|||||||
1
inputs/input15_dennis
Normal file
1
inputs/input15_dennis
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user