Solve day 4

This commit is contained in:
Nettika
2023-12-09 20:19:35 -08:00
parent 637b097245
commit 001eeb692f
6 changed files with 315 additions and 0 deletions

16
04/puzzle_test.py Normal file
View File

@@ -0,0 +1,16 @@
from card import Card
from card_test import mock_input
from puzzle import _resolve_copies, solve_pt_1, solve_pt_2
def test_solve_pt_1():
assert solve_pt_1(mock_input) == 13
def test_solve_pt_2():
assert solve_pt_2(mock_input) == 30
def test_resolve_copies():
copies = _resolve_copies([Card.parse(card_desc) for card_desc in mock_input])
assert copies == [1, 2, 4, 8, 14, 1]