-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
0 3 6 9 12 15 | ||
1 3 6 10 15 21 | ||
10 13 16 21 30 45 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from day09.day9 import INPUT_SMALL, ValueArray, get_input, interpolate, part1, part2 | ||
|
||
|
||
def test_get_input() -> None: | ||
values: list[ValueArray] = get_input(INPUT_SMALL) | ||
assert len(values) == 3 | ||
assert len(values[0].sub_arrays) == 3 | ||
assert values[0].sub_arrays[0] == [0, 3, 6, 9, 12, 15] | ||
|
||
|
||
def test_interpolate() -> None: | ||
values = [0, 3, 6, 9, 12, 15] | ||
assert interpolate(values) == [3, 3, 3, 3, 3] | ||
|
||
|
||
def test_part1() -> None: | ||
values: list[ValueArray] = get_input(INPUT_SMALL) | ||
assert part1(values) == 114 | ||
|
||
|
||
def test_part2() -> None: | ||
values: list[ValueArray] = get_input(INPUT_SMALL) | ||
assert part2(values) == 2 |