Skip to content

Commit c489933

Browse files
committed
Day 12 Initial
1 parent 144697f commit c489933

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

2023/day_12/Python/springs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
4+
def calculate_arrangements(input_line: str):
5+
groups = input_line.split('.')

2023/day_12/Python/springs_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
from springs import calculate_arrangements
3+
4+
5+
@pytest.mark.parametrize(
6+
"input_string, expected_arrangements",
7+
[
8+
("???.### 1,1,3", 1),
9+
(".??..??...?##. 1,1,3", 4),
10+
("?#?#?#?#?#?#?#? 1,3,1,6", 1),
11+
("????.#...#... 4,1,1", 1),
12+
("????.######..#####. 1,6,5", 4),
13+
("?###???????? 3,2,1", 10),
14+
],
15+
)
16+
def test_arrangements(input_string, expected_arrangements):
17+
# Assuming a function `calculate_arrangements` exists that takes the input string and returns the number of arrangements
18+
assert calculate_arrangements(input_string) == expected_arrangements

0 commit comments

Comments
 (0)