From 78791ae1792b1e41ba279475c90879679760938a Mon Sep 17 00:00:00 2001 From: Caleb Date: Tue, 12 Dec 2023 22:16:45 -0600 Subject: [PATCH 1/6] Day 12 Solution. Not my best --- TheoreticalHybrid/Day_12/example.txt | 6 + TheoreticalHybrid/Day_12/input1.txt | 1000 ++++++++++++++++++++++++++ TheoreticalHybrid/Day_12/main.py | 118 +++ 3 files changed, 1124 insertions(+) create mode 100644 TheoreticalHybrid/Day_12/example.txt create mode 100644 TheoreticalHybrid/Day_12/input1.txt create mode 100644 TheoreticalHybrid/Day_12/main.py diff --git a/TheoreticalHybrid/Day_12/example.txt b/TheoreticalHybrid/Day_12/example.txt new file mode 100644 index 0000000..c5bec3a --- /dev/null +++ b/TheoreticalHybrid/Day_12/example.txt @@ -0,0 +1,6 @@ +???.### 1,1,3 +.??..??...?##. 1,1,3 +?#?#?#?#?#?#?#? 1,3,1,6 +????.#...#... 4,1,1 +????.######..#####. 1,6,5 +?###???????? 3,2,1 \ No newline at end of file diff --git a/TheoreticalHybrid/Day_12/input1.txt b/TheoreticalHybrid/Day_12/input1.txt new file mode 100644 index 0000000..2257f25 --- /dev/null +++ b/TheoreticalHybrid/Day_12/input1.txt @@ -0,0 +1,1000 @@ +#.?#.#???????...??## 1,2,2,1,1,4 +???#???.?#?????? 1,2,2,3,2 +???????#??.???#? 2,2,4,3 +.???????#?? 4,1 +?????#????. 1,2,1 +#.?#???#???.?#. 1,3,1,1,2 +???#?.#.?#??????# 1,2,1,9 +.???#????? 4,1 +#????#??..????? 1,2 +??.#?.???????#??? 2,1,6,3 +???.???????.#.#?#?. 1,3,1,1,1,1 +???##?????????????## 12,2 +???#?????.?#??????.. 9,1,4 +?????#?..???????##?? 4,1,1,6 +.?#.?.??????.????#. 2,2,5 +?##?##.#?##?#????. 5,4,2,1 +???..??..????? 2,1,4 +?????#?.?##.??##?. 5,3,4 +.???.#.#??????.??? 3,1,1,1,1,1 +?.???.?#???#??#?# 1,3,1,1,6 +.?.??..???#???#????# 1,1,12 +..?.?..??? 1,3 +???.????????? 3,1,1 +.?????.??##??? 3,2 +.???????#.### 2,2,1,3 +##???.??????#?#?#??? 3,1,1,10 +.?##??##??#??? 3,3,1 +.????.????????????? 2,1,3,1,1,1 +???#??#??.#?? 8,1 +???.????.?? 2,1,2 +??#?#?.????? 4,1 +???????#???#?#?#? 4,9 +#.???????. 1,1,3 +?#??????.? 1,1,1 +?#???##?.???..???? 8,2,1 +????????#???.# 9,1,1 +???.???#???#?????? 1,1,1,3,4,1 +?????##?.??#? 1,5,3 +#??##.?.????#???? 1,2,1,6,1 +?????#????#???? 1,1,7 +????????..??????? 1,2,1,3,1 +?##?...???#.?? 4,4 +?????#.?.??? 2,3 +????.?????#???### 1,1,5,3 +#.???#?#?????# 1,3,1,5 +.????#?.?????#????? 4,5 +.??.???.#?#?#?#.? 2,1,7 +.??#?????.?. 5,1 +??#??##?.???? 4,2,2 +?.?.###?.?#?????##? 1,3,2,5 +?#??????#?.??..?# 2,5,2 +.????????##?.? 2,4 +????##??#???????. 12,2 +?.#??.??????#??#?# 1,1,1,9 +?#?#??#??#?.???????# 8,1,3,1,1 +.?????????.??#? 2,1 +??##??.??.? 1,3,1 +??.????##???#????# 1,1,7,2,1 +????.#???#??##????.? 2,1,9,1 +?.??###?.?.??? 4,1 +??????#.??????? 6,3,1 +??.?????##??. 1,1,6 +.#????#??? 1,1,1 +??#??.??.?. 4,2,1 +?.????????.?.... 1,1 +#??..?.#??.?? 3,3 +..?#???#?#??#?..#??? 2,8,1,1 +???#???.??? 4,1,1 +????#?..?.?????? 3,3 +??????#????#?.?.?# 12,1,1 +#??????????#..? 1,3,1,1,1 +???#??#.?#????#? 4,1,2,2 +#.?#??#?#???#?.# 1,1,6,1,1 +??????.??????. 1,1,2,2 +???#???#?. 1,1,1 +..??.????#?##??#?? 1,1,9 +???.????#?? 1,5 +.??.?.???? 1,1,1 +??.#????????????#. 1,8,1,2 +?#?????????????? 5,1,5 +..??.??.#?#?? 1,1,1,3 +?????#?????...???? 5,1,1,1,1 +.???.??#??# 3,5 +???#.????#??????# 3,2,1,1 +??????####?.?? 1,8,1 +..???#???..??? 4,1,2 +????##?#?.#?.?? 2,5,2,1 +??##?#???????.??.. 8,1,1 +??????????#? 2,1,1 +?.?#???#????.???#?? 1,3,1,3,1,3 +???????#?? 1,3 +???.?#...##???# 1,1,2,1,1 +#?.#?#?????. 1,1,1,2 +.##.????###?.?.? 2,7,1,1 +?#????#???????#???. 9,2 +?.#???#??##????? 1,2,6,2 +.#?#???.?#??????# 3,1,1,2,3 +?#?#??.?..???#?. 4,1,4 +?###..?##???#??#. 4,3,1,1 +.#??.#????..?..?? 2,1,2,1,2 +?..??.??????.?..? 2,3 +.?#.??##???????.?? 1,9 +???..???????###???. 1,1,8,1 +???##??????.? 3,3 +???????#??? 1,1,3 +??.??????##.??. 1,1,6,2 +.##????????????????. 2,5,1,2,1 +?#??#????? 1,4,1 +#??????.???#???? 4,1,2,1 +.##??.??#???#?????? 3,11 +.?.??..???.#??? 1,2 +...??..??.#????? 2,1 +.??#?#?#?#???#?? 9,3 +.?#????..##?? 3,3 +##??##?????#???#??? 13,2,1 +????????????#??# 1,1,6,1,1 +?#?##???#??? 1,6 +##????#.?#??.#?????? 5,1,2,3,1 +??#????#??? 1,4 +?.?.?.????##?#?##?? 1,1,1,7,2,1 +?????????.??.??. 2,2,1,2,1 +??????.????? 4,5 +??#?.???#?#??.???? 2,1,6,2 +.#.??#...#?.??? 1,1,2 +..???.??.?. 1,1 +#????.????? 1,1,4 +?#.???#??##??? 1,1,3,1 +???##???##??#?##.#?? 15,1 +?????.#.????? 1,1 +???#?#?###??????? 1,8,1,1 +?????#????????.#?# 2,7,1,1,1 +.????????.#?.#. 3,3,1,1 +???##?#?.. 1,6 +????#????????#?.??. 6,3 +.##?#?.????????? 4,1,2 +?#?...????#? 3,4 +???.????#? 1,3 +???.#??????#??.#??. 3,8,1,1,1 +.#???##???? 3,3 +??????#?????. 6,1 +???.?.?????#? 3,3,1 +??##???#????.?#?#?? 4,4,2,1,1 +???#??.??.#??#? 3,2,2,1 +##?##???????????.? 7,2,1,1,1 +.?.??.#????? 1,1,3 +?.??????.???#????# 1,1,4,1,2 +??#???#?.#?#?##.? 4,2,6,1 +..??#..??###?? 2,5 +?#????????..?#???#? 3,3,1,3,2 +?.???????? 2,2 +#?????#?###??? 1,9 +??.???##?.???????#?? 1,1,2,10 +?#?#.????#?.?#??? 4,5,5 +???.????????..? 1,5 +???#?????.?#.???##?. 2,6,1,5 +.????????###??????? 2,1,6,1 +??#?.?#?.???? 3,2,1 +.????#????.# 1,1,5,1 +??????##?.?..??? 2,3 +.?#??????. 2,1 +?.?.???????.???????? 1,1,1,4,6,1 +??.??.#??##??#???? 1,11 +????????##?#??? 12,1 +?#??#?#.????#?#???# 6,9 +?#???.#?.. 3,1 +??#?.?#?????. 4,2,4 +.??.?..??#??? 1,4 +???#..??.?#??????? 1,1,1,4,3 +?###???.?#???? 6,5 +?.#?????????.?# 1,2,3,2,2 +.?#?.#????##.?. 1,7 +?.?#..???????? 1,1,2,2 +?????.??#?.?#??..? 1,3,4,1 +#??..??????????##? 1,1,1,1,3,5 +?????.??#??##???? 2,1,6 +..?.?#??###????. 2,4,1,1 +##??.#????#?#???.. 4,6,2,1 +??#?#??#.#???#??? 4,2,1,6 +.#?#????#..?#??#. 8,4 +???..???#?..#??? 2,5,1,1 +?##?.?.???##?????.?# 2,1,1,7,1 +??????#.?.?#???#.? 1,3,1,6 +?????????#????#? 3,5,2 +?.##?##???#? 5,3 +???#?#??#?#?# 1,10 +?##??#???? 3,1,3 +??#??#????.??.?##. 1,3,2,1,2 +???????##????? 1,5,1 +??##????#.???# 9,3 +?.??????#??.?.????. 9,2 +??.??????#???? 7,2 +??#?.??.#.??? 4,1,1,2 +??.#??#??.?? 6,1 +#??????????? 1,1,2,1 +?##???##?.?##???? 8,5 +?.?#?#??.?#??#?.? 3,4 +.#?.????#??#?##.. 2,1,7 +?#?.#?##.? 1,4,1 +?????##?##??? 7,2,1 +??.?.?##???? 2,7 +???.????#???. 1,6 +?#?????.??. 5,2 +????#??.#?#. 1,2,1,1 +.???.????#?#?.?? 3,6,2 +???.??.?.?.? 1,1,1,1 +?#.#????#??#??? 1,7,1 +.???#?????#??.?? 1,2,2,1,1 +..??.???##..? 1,5,1 +.???????..? 2,2 +?#????????????#? 2,2,4,1 +????..??##?...#????? 1,1,4,1,1,2 +?#.???#?????????? 2,4,4 +?#??..??.#? 2,1,1 +?.?#??????.??#?..?# 1,7,1,1,1 +#??#..???? 2,1,1 +??#?.??#?.???? 2,2,3 +.#???..??? 1,2,1 +.??.?#?##.#???.?#? 1,5,3,1 +?????.?#?#??????#?? 1,1,7,1,1 +??#??????.?#??#?#? 1,5,8 +??.?.?.???????? 1,8 +?#?#???#?????# 1,9,1 +.??#.#??.?#???##?# 2,1,1,1,4 +???#???.??#?#? 6,1,1 +?###???.?#.?..? 4,2 +?#???.????.??#.???. 5,2,1,1,1,1 +??????..??.?.##.? 1,2 +?.#?#??????...????? 9,1 +..??.?.#?? 1,1,2 +??##???????????.##? 9,1,1,2 +.???.?????? 2,1,1 +??#.#?.?#?????.?.? 1,1,1,1,3,1 +???#????#????.#. 1,1,7,1 +?????#?#?.?.. 6,1 +???.???????#??#????. 1,12,1 +??.??.?#??# 2,5 +?.????#?#????. 1,4,1 +???##????#??? 4,3 +???????##. 1,1,3 +.?.##???#?.?#????? 1,3,2,5 +?.??.##??.? 1,2,2 +???????#?#???? 3,1,7 +#?#.??????#?#??.?.?. 3,2,8,1 +.??.??.???? 1,2 +???????..?#??? 4,1 +?.????##?? 1,5 +????#??#??.?#. 7,2 +?.##????##?????#???? 2,5,5 +.??#.???...##?? 1,1,1,1,2 +#??????##???? 1,1,3,3 +?###??????????????? 6,11 +?#?.#????#??.? 3,2,2 +.????#?????#?? 10,1 +?????#???? 1,1,5 +?#?????.?????#??#.. 1,1,1,1,1,4 +????#??.?# 1,5,1 +???#?????? 4,1,1 +?#?..?.?.?? 2,1,1 +#??.??#??#?##??#???? 1,4,1,5,3 +?..?#?#??.#???? 4,1,2 +?????#???#??#.?#??? 13,1,2 +?..#??.??? 2,1,1 +???#????#?.????#? 8,2 +.???#.???##?????? 1,2,1,9 +#..#?#???## 1,5,2 +??..?#.??? 1,1,1 +??????#?.??.???#. 1,3,1,4 +.?##.?..???##?. 3,1,4 +?#????#?#?????.? 9,4 +??##?.?#??##??. 5,7 +??#????####??..#???? 11,4 +..#??????? 3,2 +?.????????##????.?#? 11,1 +.?##????#???. 4,1,4 +#???.???????#. 2,1,1,5 +#??????#??.?? 1,1,5,1 +???????##???#?#.?#? 1,1,5,3,2 +?##????##??##? 2,2,2,2 +?##?#????..????#?? 5,3,7 +.????.#???#? 1,1,2,1 +??##???#.?.?#.#?? 7,1,1,3 +??.#??#.?#?????.#? 1,1,1,6,1 +???????.?#????? 3,1,5 +??.?#?.?#?? 2,3 +?##??????.?##?? 5,1,4 +???.#???#?????#???. 2,12,1 +???#??##???#??# 1,6,3,1 +??.??.#??####??#?#? 1,2,2,10 +??????.?.??????. 2,5 +...???.??##?... 1,3 +????#..#??#?#?#??### 1,1,13 +????????.???.?#.? 4,1,2,1,1 +??##??????#????? 7,4,1 +???????#?#?#?????#.? 1,1,4,4,1 +..?#???#????? 4,4 +?#??.##???.#?? 2,5,1,1 +.??????#??.#?.?. 1,1,3,2,1 +#???.??????????? 1,1,1,9 +??.??.?#?.? 1,1,3 +#??????#??? 3,4 +??#??.??.???#.??# 4,2,4,3 +??#???????..?.???### 4,1,1,1,1,4 +?.?????#??#?????.. 7,1 +?????..?.# 1,2,1 +.???###???????###??? 10,6 +?#??.?????? 3,1 +.#.??#??????? 1,2,1,1 +.??#??????#? 1,8 +?.?#??..?????? 4,4 +?#?#.#.?.?#????? 4,1,1,1,4 +?#.?.?###????? 1,1,6,1 +.?#?##?###??.?..? 9,1,1 +..??????#??????#??? 7,3,2 +???#???#?????.. 7,1 +??##????.??#??. 5,1 +???#????.#?#????? 1,1,1,1,5 +????#?????.? 1,5,1 +?????#?????????#?..# 4,5,6,1 +?????#?#???.?..???? 6,1,1,1,1 +?.???#?#?.#?.?.? 1,5,1,1,1 +?##????.?.?##?? 3,4 +.#?..????. 2,1 +??#.##??.. 1,3 +?####?#####?????? 11,1 +.??.#?..??#.???? 2,3,3 +???..????#?#?. 1,3,3 +????????#??? 1,2,4 +##???.??.#?#????##?# 2,1,11 +??.?##??.?..?#??. 3,3 +??.#.#.??.????? 2,1,1,1,2 +?????..?#???? 4,3 +??????#?#??###??? 2,4,5 +??#??#?#.?? 8,1 +??#?????#? 6,1 +??.##?#?#?#???# 8,1 +#?#?##???#??#?#????? 1,5,2,1,1,1 +.?.#?#?#..??. 5,2 +??##?###????? 7,1 +?.#???????##????? 1,1,4,2 +.??.??.?.?#?????# 1,1,3,2,1 +.#???????.??#?? 2,1,4 +????##?????.#?? 8,1 +????????.#.. 5,1 +?????#?#???? 6,1 +..?..???????..?#?# 6,3 +??.?????#?#? 1,4,1,1 +.?????#..???? 2,2,1,1 +.#??????#???##??? 1,1,7,1 +??.?##??#.????..? 5,1 +?.??#.????? 1,1 +???.?.?????#??#???# 1,1,1,1,8,1 +.?#??.##.##??#??#??? 2,1,2,6,3 +?.???#??????.? 4,1,2 +?.?????#.?? 3,1 +#???##?.?. 6,1 +????.???##?#???????? 1,1,4,3,2 +.??.?#?.## 2,1,2 +???.??????????.?? 1,10,1 +.???.?????? 1,1,2 +??..???????#?..?#?#? 2,4,3,5 +#?##?.????? 4,3,1 +???#??#?#????#??#??? 7,7 +??#.??##????. 2,4,1 +??#??????????.#?? 1,6,1,1 +????##?????.?#???? 7,1,4 +?.??????????#.???? 9,2 +???????##.????#.? 6,5 +????#??.??????#???? 3,2,1,5 +.???#?????#.?..???. 9,1 +#..??.??##. 1,2,4 +???????#?#..? 2,1,1,1 +?????????.????? 2,5,1 +???#?#???.? 1,6 +?#???##?#?. 2,6 +?..??#???? 1,1,1 +?????#?.#.? 2,1,1 +.#.????#??#?##?? 1,1,11 +?.??.#??#????#. 1,1,1,6 +?...##.????#.? 2,2 +?????.???#??.#. 1,1,6,1 +?#???#????###?#. 1,1,1,8 +??#??.?.?. 2,1 +#??????????.????##? 1,1,3,1,6 +?.?.?????#??????#??? 1,1,9,1 +???#??.????????##?## 1,4,4,1,5 +.#???????. 3,2 +???#.????.?.####?# 1,1,3,6 +....??????#???? 3,6 +.??????#??????.? 5,3 +?.????.?## 2,2 +?#????#?..?#? 7,1 +.?#??????.??? 6,1 +?.?#????????#??. 2,3 +?..????#???.?#?? 3,1 +##???#???.?.?.? 2,3,1,1,1 +?.??#?.?#?#?####?.?. 2,9 +.??..##?????. 1,3,3 +.?#???##?#??.??..? 4,6,1 +?.?#?..??#?#??. 3,6 +???#?????##?.??#?#? 3,2,2,6 +?#????#?.?#.#? 3,3,1,1 +???#??????????????? 1,4,3,6 +.##?#?.?#????##?? 2,2,7,1 +?????#????.??.?.#??? 8,1,2,1,1,1 +#.?.?????#?..????.? 1,1,7,2,1,1 +..##?.#?.??#?.# 2,1,1,2,1 +??#??...?#???##. 4,2,3 +#?#?#????????????? 7,3,1,2 +..#??#?##. 4,2 +##?####.#??.??.?? 7,1,1,1,1 +??#.???##??#.#?#? 2,8,4 +?#????#..?.????#?# 2,3,2,4 +?.?.#.?????#?#???. 1,1,1,2,1,6 +?#???##?#.##???????. 8,6,2 +????.??..??##?#? 1,2,1,5 +???#??.#?#????? 1,1,1,1,5 +????###?#?????? 1,12 +???????##????#?##? 1,2,8,3 +#.???.?.?#??????. 1,1,1,1,7 +?.?#....????. 1,4 +??.#???.?#? 1,2,1 +?.?.?#???? 1,5 +????#?.???#?? 5,1,3 +??#?#??#.?.?? 8,1 +??#.?#??#.??.?? 1,2,1,1,1 +???#???..??#?? 1,1,3 +??.#??????? 1,3 +?.?#?#?#???????#? 1,8,1,3 +?.?####??.?.?.? 5,1 +?#???#?.???.?##? 2,3,1,2 +.#??????#??..? 3,4 +????##?.????#???#? 1,3,1,1,5 +???????#????#????#?. 1,2,2,3,1,1 +??#..?????#???? 1,2,3 +????#?.??? 1,1 +??.?#??#???.????? 1,5,2,2,1 +..??????#.???# 5,1,1 +?#?#?##.????. 6,2 +?##.?????.??... 2,4 +.????.#?...?##.# 1,1,2,3,1 +.????#?#??# 2,7 +?#?#.##??#?#??.?#??# 1,1,7,1,2,1 +????#?????? 1,3 +????##?#?..#?#?#??? 7,5 +.?.???.??.?? 1,1,1,1 +???.???#??.???#???# 3,4,3,3 +.??##???#??#???#??.? 12,2,1 +????#?#?#???#.#???.# 1,7,1,1,1,1 +.?#?###??#??.?#?? 7,1,1,4 +.#????.?#?#. 1,1,3 +?#?????.?? 2,2 +??.???#.?????? 1,2,1,3 +?#.??##???#?.. 1,2,1,2 +??.??.???#??? 2,4 +???.????.?..?? 2,1,1,2 +?#??#####???#.?????? 3,9,2 +??.??.??#???#? 1,1,3,4 +??#.?.??#???#??. 2,1,2,1,1 +?.?????#?? 1,7 +?.###????.??. 6,1 +.??#??????#?##?? 8,1,4 +???##?#???.??.? 6,1 +.??..####? 1,4 +??????.??????# 2,2,1,1 +?.#???#.??#?? 5,3 +?...#?#?.???#??.?# 1,1,1,3,1,1 +#???.????? 1,1,2 +??#..??#?? 3,3 +#????.????#?#..?#. 2,1,1,5,1 +.#?#??????????????? 1,1,7,1,1,1 +??#?????#??.??.?## 11,1,3 +#??#????#????? 9,1,1 +?????##?????#? 2,8 +???????????.???###? 9,1,3 +??#?.?.???.#.?. 3,2,1,1 +?.??#?#?????.???? 1,4,1,1,4 +.##??????? 3,1,1 +?????#???#????? 1,1,4,1 +.??#?????..#????? 6,6 +#??#??#????????# 13,1 +??###?????#??????# 9,1,3,1 +##???.???#?#?????# 2,2,1,5,1,1 +.??...???#? 1,4 +?.????.???.???#?#? 2,1,2,3,1 +??#?#????? 1,1,2 +???#??????????? 3,6 +??#?.?#?#. 2,4 +.?#????????.??? 3,4,2 +????#.???????? 3,8 +.??.???#?#???. 2,4 +?.??#????#.#.??# 1,8,1,2 +..???.?#??. 1,1,1 +?????#..?#???# 6,2,1 +?###???.#.???#?.??.? 6,1,2,2,1,1 +?.??##??##???? 1,3,6 +????#.??#??#??#??? 3,2,1,4 +#?##?????.##????#? 5,2,7 +????#??##?..??? 1,2,3,1 +???????#????#?? 1,3,2,1 +##??#???????..??#. 8,1,1,1 +.##?#?##?#??#?#?#? 12,1,1 +??????##?.????? 9,2 +????????.. 3,1 +?.?#??..?#???.# 1,1,1,5,1 +.#???..?#.?#???? 1,1,1,2,2 +#.#?#?#?#.#??.???? 1,7,2,1,1 +????#??.?#?#??????#? 1,2,1,11 +?.#???.??.?#????## 1,2,2,1,5 +?#???.??.#?#? 4,2,1,2 +????.?.????#??.?? 3,7 +?????.#???.# 1,1,1,1 +#?.?.???#?##??? 1,1,2,5,1 +.?.??#.?#?..?#?????? 1,1,1,2,4,1 +??????#.??????? 4,1,1,2 +???##??###? 3,4 +????.#?????#???#.# 2,2,1,1,1,1 +?????.???#??#???? 4,7,2 +#.??#?????#?. 1,5,3 +?##????.??. 3,2,1 +????..??##? 1,1,4 +?.#??.?#??.??????#? 1,3,2,1,4 +????.?#???. 2,2 +#.???#?.?#?? 1,1,1,2 +??##?.?#???##??.## 4,7,1,2 +?.?????.?#? 2,1,2 +????????### 2,6 +#?.?????#?# 1,6,1 +??#?#??.??????.??.. 3,1,1,4,1,1 +?#?.??.#?? 1,2,2 +.??????#.#??.#????# 7,1,3,2 +??##???###?#??????? 5,8,2 +?#.??#?????#??#?? 1,6,1,2,1 +?.##??#?#???. 1,2,3,1 +#???#????#?#????? 6,1,4,1 +?.?#..?????????# 1,1,5,1 +???#???.#??? 4,1,1,1 +?#??#?##.??? 4,2,1 +?####????#? 6,3 +?????##??#?##??#???? 1,11,3 +?????????????#??#??? 1,1,1,1,1,7 +???????.??##.?#?? 3,1,3,3 +???#?.????? 3,1 +??.#??????#???.?#.? 1,1,1,5,2 +?#???#??.. 1,1,3 +??#?#???????? 5,1,1,1 +?#.???#??#???#?#??? 2,3,9 +????##?????.?#???# 1,2,1,2,6 +?.????#???????.?? 1,8,1 +.??????#?#?? 1,9 +.?##..???#??.?# 2,1,1,1,2 +.#?#?????#????????#. 1,1,1,2,7 +??#??????#?#? 3,1,3 +?????.???..???? 1,1,2,1,2 +.???.???.#?#? 1,1,1 +????#.??#?#?.?##??? 3,2,2,4,1 +.????????.#?#??#? 1,1,1,4,1 +?.#??##???????? 1,2,2,2,2 +.?????#?????##? 3,1,2,2 +???#??????.?? 1,3,3,1 +.???#?####?#??.?# 1,11,2 +#?#..????#?. 1,1,1,2 +.???????#??#??? 3,5 +?.?.???#?.?#??. 1,1,1,3,3 +?.??#?#####?.#???.? 8,4 +??.???#?.#??#????#?# 5,5,3 +.??????..??? 1,1,3 +#????##??????? 3,3,2,1 +#?.?##??##????. 1,9 +??#??#.????#?.?#?## 3,1,2,3,5 +.???#?????.?? 3,1 +..????????#???.. 8,1 +?????#?.???# 4,2 +?.?.????#??.???##? 1,1,2,1,1,4 +??#?#..?#???#?#??.?? 4,8,1 +?#??.??.?#? 3,1,2 +?.?...##???? 1,5 +??#?.??????? 2,5 +???.??##?#?#??? 1,1,7,1 +.??.???????#???? 1,9 +??##?.????.?#???#?? 5,3,1,4 +#?????#?.?? 2,3,2 +??#??#???##??????.? 4,11 +???????##????. 1,11 +?#??..?#??#??? 2,6 +????????#?#????#???? 1,1,8,1,1,1 +?..?.#??.???#?? 1,2,2,1 +???#?.???#? 4,2 +?.??.#?.??? 1,2 +???.?????#? 2,3,1 +?..#??#???#?#.? 1,1,1,5 +?#?#?#??????#.?#???? 13,3 +????#?.??????? 2,6 +???..#???.????#? 2,4,4 +?????#.??#?#??#?##? 1,1,1,6,3 +.???????????? 2,5 +.??.??.?????.??#?#? 2,1,1,2,3 +.?#?#??????.###?#.? 5,2,1,5,1 +??.??##???#?.?.????. 7,1 +.#??.?#???#?#?????.. 3,12 +?..??..#?.?.?? 2,2 +???????.?#????. 1,5,2,1 +##?.?#.???????#??#? 3,1,1,2,2,1 +?.??#?.?????????. 4,1,1,1,2 +????.??##? 3,4 +?..??.?#???#?#???#.? 1,11 +???#??#?????????. 1,4,4,1 +#????#?.??#. 1,3,1,1 +.???..??????.? 2,1,2 +.??????????#?##?.?? 1,7 +#.?.#.????#?.#? 1,1,4,2 +???#?.?.??#. 4,1,1 +?.??#??.?.?.#????# 3,1,1,1,4 +??????#?#.?# 2,4,1,1 +?.?????##?.??.??? 1,1,4,1,1 +?##????.?.#?# 5,1,1,1 +..??#??#??. 1,3 +??????#?#???..??. 9,1,1 +?.#.#?##?##?#???# 1,1,1,7,1 +??.?#????? 1,1,4 +?.?.??#?#.??#????. 1,5,5,1 +???.?#?#??? 1,1,1 +??#??????? 1,2,2 +..????.??#.? 1,3 +???.??..??#?##??.?.? 2,7,1 +?#?.???.????.?? 1,3,1,2 +#?????#.???# 5,1,1,1 +??.??.???#???##??? 2,7 +?.?.#?#??.???..? 1,1,3,1,1 +.#?.???..###??????#? 2,1,5,5 +??.??????????.???? 8,2 +??????????? 4,1 +??#??#???.#. 3,2,1,1 +???#????##?.?#?#? 4,4,4 +??#????#?????.. 2,8 +?.???.##?????? 1,1,6 +??#.?##???#?. 2,2,4 +???#?#?????????? 6,1,2 +?.????##?###?##? 9,3 +?????????? 1,4,1 +.??#?????? 4,1 +.??##..?#?#? 2,4 +?????#??#??#?.#.? 1,8,1 +.??.?##?#?#? 1,7 +????????#??. 2,6 +??#.?.#???.?? 2,4 +?##?##???##? 7,3 +?#????????#? 3,3,2 +?.?????##?? 1,4 +.????????.??? 5,3 +##.????#??? 2,3,1 +?#?.?..??. 3,1,2 +????????#????##??### 1,3,3,9 +??????#????#????? 2,4,1,6 +???.???.#.???#?##? 2,1,1,1,5 +???###?.#?????##.. 6,8 +???#???#?##.??#?. 3,6,1 +?#???...?.??###.??.# 4,1,4,1,1 +??????#??#? 1,2,2 +??????.??.??. 1,2,2,1 +?.?.#????? 1,1,1 +.??????.#??? 1,1,1,1 +?.?#??#??.????#??.?# 2,2,1,3,3,2 +??????.?.#?#???.? 4,1,1,2,1 +?????#.###.? 1,2,3,1 +???##??#??#???????? 12,4 +?#?????????? 3,1,1 +?.??#??.????#? 5,1,3 +.???##???? 1,2,1 +?.???????? 4,1 +.#?.?.???? 1,3 +??#.??????# 3,3,1 +??.?##?.?.??#?? 1,2,1,1,2 +.????#??.##??.?#. 2,4,2,1,1 +?????.#??. 2,1,1 +?#?????#.? 2,1,3 +?.?????#?? 1,5 +??????#?#..?? 1,1,1,2 +?????.????###? 1,2,1,5 +.???#?#??? 4,1 +.?.?###????? 1,5,1 +??????????..?###? 6,1,3 +????#?#?#?????###??? 2,3,3,8 +??#?..#???? 1,3 +???#???.??.?? 4,1,1 +??#..???#???#??? 1,1,5,4 +??..???##?.??#..? 1,4,1,1,1 +#??#.?#????? 1,1,4,1 +.??.?##????# 4,2 +??#??#????.???# 1,1,1,1,2 +?#.????.?.????#??.?# 2,3,1,2,3,1 +##???..?.?.????? 5,1,2,1 +???.?????????????#?? 1,15 +??##???.??#??? 1,5,2,1 +.?.??????#?? 2,3 +?.#???#??? 1,2 +.??.??..???# 2,2,2,1 +????#?#??? 1,4 +??#??#???? 1,3 +??#..??#??????? 1,1,1,8 +??????.????#???#.? 1,2,1,6,1 +.???##???? 1,2,1 +.?????.?#..?. 4,1 +#?.???####?#?.???? 1,1,8,1,2 +.?.?#..??#??.? 1,3 +?????#????????#??. 1,6 +#???#??.??# 1,3,3 +?????????? 7,1 +??.???.??? 1,1,1 +??????#??.???????.#? 1,2,1,5,1,1 +?#??????????????#?. 5,2,7 +#???.?.??.?..#? 3,1,1,1,1 +.????????????.???.# 1,9,1,1,1 +?#?#??????#???## 6,7 +..??#.???#.#.????#? 3,3,1,5 +?????###?????##???. 16,1 +????????#??????#??# 1,1,7,5 +.#?????#???####??#? 2,4,8 +?#.????###?#?. 1,1,1,6 +?.??????###??#?? 1,1,6,4 +.?..??.??.???#?.##? 1,1,1,5,3 +?????.?#??#??##? 1,2,1,1,3 +?#??.?.#?? 3,3 +.?????#??.?.# 1,5,1,1 +.???????.??#?##?#?#? 1,5,1,9 +????#?#??#. 5,1,1 +?#????.##?##?..?# 5,6,2 +.?????.??#????#???# 1,3,5,2,1 +?##????.#??????#? 6,1,1,1 +??##?.????##??#?#?? 5,4,4 +.???###??...?????? 1,4,1,1,1,2 +???#?..???. 3,2 +.?.?.#???##???.. 1,2,6 +????#?#?#?????. 10,1 +.???#??.??.??? 2,1,2 +?..#?.?#?????.?? 1,2,1,3,1 +??????.??#?#?#. 1,1,3,3 +??#??.?##?????##??? 2,3,4 +?#?.#.???? 2,1,1 +.?.?#?#?####.?.#?# 1,3,4,1,1,1 +??.#?..?#?????? 1,1,3,1 +#??#??#??.?# 2,6,1 +?#??#???????#??#??? 5,6,2 +?..#??#?#####.?#???? 1,10,1,1,1 +??.????#???#?##?? 1,9 +????.?#.?# 1,1,1 +???????????? 6,1,2 +#..????#?#?#??##.??. 1,3,1,1,5,2 +??#?.????###???? 1,1,1,6,1 +????.????#?.?# 2,1,1,1 +???##????.?.???.??. 1,2,2,2,2 +?????.#?#.???.??? 2,1,1,1,2 +???#??????.?? 4,1,2 +?#?#?????#?#..??#. 11,2 +.?#?##?????###???.#? 6,7,1 +#?.##?????# 1,8 +#..#????????? 1,3,1,2 +????#??#??? 2,2 +.?##?.?..?.???.?# 4,1,1,1,1 +?.????.?#?.???? 2,1,2,2 +??#??#?.?. 6,1 +?#??#??#??##..?## 3,1,6,3 +??#.???##? 2,4 +#??#????.?????..?.? 1,5,2,1,1 +.?#??#??#????#?#?? 2,2,10 +####????#??##.?????? 5,1,3,4 +???##.?.??.? 1,2,1,1 +.?#?????##?????##?. 8,4 +.?#????###??#??#???? 2,11 +???###?#???#????# 9,1,4 +??.??.?.?#???. 1,1,4 +#???#??#?#?#???##? 1,3,1,1,1,2 +#????##?.? 1,6 +##?.?#?#??#?? 3,7 +??##????#?.?.?#?#??? 1,2,5,1,1,4 +.?#?#?..#?.... 4,1 +##?#?#??????. 2,4,1,1 +?????????#?????? 1,3,1 +?.??#??????? 3,1 +###?????#?#??#.#??. 3,2,4,1,1,1 +.#???.??###? 1,1,5 +?###???.?????. 5,2 +?##???????????.? 3,1,5 +??#??#?####??.?? 9,1,1 +##??#..??????.??#??? 3,1,1,4,2 +.???.???...?????? 1,1,5 +.?????#????# 3,2,2 +.####?.???? 4,1,1 +?#.?#??#??##?????? 2,12 +.????#?.???? 2,1,2 +??#????#??#?? 3,5 +?????#???#.?..??#??# 9,2,2 +??????.?#? 1,1,3 +?#?.#?????. 2,1,1 +?#??.???.? 2,1 +???????#?.. 6,2 +#?????#?#??..# 10,1 +?????????. 1,2 +...??.##?????#??.?? 8,1 +#??????#??##???.? 2,4,6,1 +?.##????#??#.?#???# 3,1,1,2,2,1 +???#??.???? 1,2,1 +#..??#??#??.?????.? 1,4,2,3,1 +?#?#.??###??##? 4,9 +.???#.??.? 4,2 +?..?.?#.????#.?? 2,2 +.???##??#???###.?.?? 6,7,1 +??##???#?.?? 4,1 +??##?#????#?????#.? 13,1 +???#?.#?##?.#?#? 3,5,1,1 +??.???#????. 1,5,1 +.??#???.???. 5,2 +??????.#??#.??? 5,4 +??#????#?##???.?#??? 12,3 +#????????? 1,1,2 +???????????#?.. 1,1,1,1,2 +??#??#?##????#???#?? 1,2,9,2 +?????..??????.??#.?. 3,3,3 +??.?#?#?????##?.#?.? 4,6,1,1 +??#????##.???? 8,2 +?#?.??.#?#?##????? 2,1,9,1 +???#???#?..??.?.. 7,2 +#.??#??#???.????.?#? 1,9,1,1,2 +????##?.?.??.?????## 7,1,2,1,1,2 +.?#?#???#???#.?.. 6,1,1,1,1 +??.?#??#????.? 1,3,5,1 +?#?.??#??? 2,3,1 +???#?##???????? 6,1,1 +?#?.?????#?????#?. 2,5,5 +#?#?#??#???.???? 6,1,1,2 +?.??#????#?.??###?. 8,5 +.##??#??#???.? 2,2,1,1 +???##?.??? 1,3,1 +?##.?.????#.#..?# 2,1,3,1,1 +?#?#?...?#?#????.??? 4,3,2,3 +..##??..????#?????? 2,9 +?#??.?#?#?????#???. 3,5,4 +???#?????.#???#??? 1,1,1,1,5,2 +????.??.#?#??# 2,1,3,1 +?#??#????#???.#? 12,1 +??????????#??????.?# 1,7,1,2,2 +??.????#?##????#? 1,2,1,4,2 +??###????? 1,3,1 +?#?#???#???.??# 3,1,1,1,2 +???#????????. 6,1 +##..????.? 2,3 +?##????... 3,3 +.?.?.?.#?? 1,3 +.?.???????????????? 8,7 +??#?###?.??..?? 7,1,1 +?????.?#?#? 2,3 +??#.??#???????#????. 1,7,1,3,1 +?????.??#?? 1,1,4 +.?????##??# 3,4,1 +..??.??#??. 1,1 +??????????.#??#?#? 6,7 +##???????? 4,4 +?????##.?#??. 5,2 +#?.?????#??? 2,2,1,1 +??#??...??? 4,1 +???#??.???#? 1,2,4 +??#?????.#? 1,5,1 +????.??##?? 2,1,3 +?????.??.?.? 3,2,1 +.#??.???.?.??#??#?? 2,2,1,2,1,1 +#????.??..??#?.#?## 5,1,1,2,4 +???????##.????.?#? 7,1,2,2 +.???.???????#??????? 1,2,1,5,2 +.?#????.??? 1,1,2 +.#?#?#?#??#???#..??? 1,10,1,1 +??.????#?.????????#? 1,3,2,1,8 +?????##??#??.????.. 5,2 +..?#???#?##?#??? 2,2,5 +??#.?#.??????#? 2,2,1,1,2 +.???.????#????? 1,8 +??##?###??????#???? 8,3,2,2 +???..#.??#? 2,1,2 +?#???#???.?# 7,1,1 +.#?.???#???#? 1,7 +???.??#???..??.? 3,2 +..?.#????????. 1,1,1,3 +????#??#???#??????? 9,1 +.?#????.?...?. 5,1 +#??.?????.???#??#?? 3,4,5,1,1 +????###??#? 5,1 +#???##?#??.?.?????? 10,1,2 +?????#?##??.?...##?? 1,6,4 +???????#???.?##??. 4,4 +#.??#?#.#??.??# 1,2,1,2,3 +?????.??????? 2,1,1,1 +?????#.##??#?#? 1,3,7 +.??????#?#???.??.?. 12,2 +??#????.####??#??.?? 3,1,4,3,1 +?#.#?????#.?#? 1,7,2 +?.?????.?????? 3,4 +??????#?.????#???? 2,1,1,1,6 +???.#???#? 1,1,2 +????#???#??. 6,3 +#?##????.?? 6,1,1 +?.???##?##.??? 7,1 +????.????#.? 2,5 +.?#???#???# 1,3,3 +##????..#??###???.?? 6,2,4,1,1 +?????#?..?#???#?? 2,2,8 +??#?##??..?#????#??? 5,3,2,2 +???#?????#?.???? 1,7,2 +.?.???#????.??#???? 5,1,1,1,2 +#????????#?.?#?? 11,1 +???#??#??? 1,5 +?#??#??????#? 2,1,4 +????.#??#.??? 1,1,1 +.?????????? 7,1 +.??#?#???.??. 1,5,1 +#???#?????.#..?..? 1,1,6,1,1,1 +?..??.???#???? 2,5,1 +???????..??##???.. 3,7 +#????.????? 5,1,2 +.??#????#???? 1,3 +?##????##?. 3,1,3 +.?..??#??? 2,1 +??#?#????.?# 4,3,1 +?##?..????#??#??#? 2,6,1,2 +??#??#?###???##?#.#? 1,1,12,1 +??##??.#?#??#?.? 1,4,7 +??##?#??#??? 6,2,1 +????.???.?#?#?##? 2,2,6 +#????.????.# 4,1,1,1 +#?????#?.???? 1,1,1,3 +?#???.##?##?#?#?.?# 3,2,2,4,2 +..#?#??#?????#?? 4,9 +??#?.??#?. 3,3 +.??.????????# 1,2,1,2 +?.????..?????????? 1,2,6,1 +??#??.????#??.????#? 5,3,3,1,2 +.#?.????.????#?? 2,1,2,5 +#?.##????#? 2,3,2 +..#?.#?##???.?#?#? 2,4,1,4 +????????????#??.?#? 4,1,5,1,1 +#?#????#..#????##??? 1,1,2,1,6 +?#???#?#?????? 2,8,1 +?#???.?#?? 2,1,4 +?#???.???#?# 1,2,6 +?#?##?.??# 5,2 +?#???.???????? 3,1,7 +?.???????????#?????? 1,3,1,4,1,2 +..???????.??? 1,1 +#?????#??#.?.#.??..? 10,1,1,2,1 +?.?#??????? 4,2 +.???#????##?????? 10,2 +?#??????##. 1,1,2 +###???????#..??#.?? 11,3,1 +.???#??.?#??? 2,1,2 +.?.?###?##? 1,3,2 +#.#?#??####?#?????. 1,1,10,1 +.??.????#?#? 1,5 +#???????#.??? 3,1,1,1 +#..????#??#?#?##. 1,13 +?.???.?#?.???#.???? 1,2,2,2,1,3 +?..????????. 1,2,3 +?.????.?....#????? 2,1,1,6 +?##?..??#. 3,3 +???.#???..??#.. 2,1,1,3 +.?#??.????? 2,1 +??????.???. 1,1,1 +???#.????#???????. 1,1,8,1 +???##???.??#??? 3,1,1,2 +????#?..??? 1,2 +???#.#??#???##?.??? 1,1,1,7,1 +?.????#.?????? 1,5,3,1 +????????.??#??#.??.? 1,6,3,1,1,1 +..???.?..?#?? 2,1,1,1 +???.??..????###?#? 1,1,1,7 +??.????.????###? 2,6 +????#??#?.?# 1,4,2 +.#.##?.?????. 1,2,2 +?.????????? 2,2,1 +?#???#???.??? 2,1,2,2 +???????##? 1,6 +#.?????#.#????# 1,4,6 +??.##?#?????.#?????? 2,9,1,2,1 +##.?..?####?##?? 2,8 +???#?.???#??#????? 3,10 +?#?????????.?#?????? 10,4,2 +.???.????#????? 1,3 +#??.?????? 3,2 +.??????.?#?#?? 1,1,6 +?????????#.# 1,1,1,1 +??#.?#???????#.????? 2,6,2,5 +??.?#?##??#?#?##??? 13,1 +.?.?#???##? 1,1,3 +#??????.##. 1,2,2 +?##??#????? 6,1 +?#????#??#.??.# 6,1,1,1 +##...???.?. 2,1 +?###???#.#?#?..?.?? 8,3,1 +??#?.???##???????#. 1,1,1,4,1,1 +#####?.????#???# 5,1,1,3 +#???###??..?#? 2,6,2 +?.???#??.#?? 4,1,2 +????#?#?????????# 1,9,1,1 +?##??????#? 3,2,2 \ No newline at end of file diff --git a/TheoreticalHybrid/Day_12/main.py b/TheoreticalHybrid/Day_12/main.py new file mode 100644 index 0000000..e0ab344 --- /dev/null +++ b/TheoreticalHybrid/Day_12/main.py @@ -0,0 +1,118 @@ +import time +from concurrent.futures import ThreadPoolExecutor + +USE_LOGGING = True +USE_DEMO = False +PART_ONE = False + +def getInput(fileName): + file = open(fileName, 'r') + + input = [line for line in file.readlines()] + + return input + +# Was used for debugging, not in use for solution +def checkSolution(proposed, map, rList): + if len(proposed) != len(map): + print(f'\t{proposed} is a different length than {map}') + return False + elif len(''.join(filter(lambda x: x == '#', proposed))) != sum(rList): + print(f'\t{proposed} does not have the correct number of hashes ({sum(rList)}): {rList}') + return False + else: + for i,c in enumerate(map): + if c in ('.', '#'): + if proposed[i] != c: + print(f'\t{map} expects a {c} at position [{i}] but {proposed} has a {proposed[i]}') + return False + + mapSections = [] + # I'm sure there's an easier way to do this, but here we go + currentString = None + for c in proposed: + if currentString is None or currentString[-1] == c: + currentString = c if currentString is None else currentString + c + else: + mapSections.append(currentString) + currentString = c + mapSections.append(currentString) + + listIndex = 0 + for section in mapSections: + if section[0] == '#': + if len(section) != rList[listIndex]: + print(f'\tList index {listIndex} expected a section of length {rList[listIndex]} but {proposed} has a section of length {len(section)}') + return False + else: + listIndex += 1 + return True + +PatternLookup = {} +def getPossibleArrangementCount(springMap, springList, prefix): + global PatternLookup + possibilities = 0 + + localPrefix = prefix + + key = (springMap, ','.join([str(sl) for sl in springList])) + if key in PatternLookup: + return PatternLookup[key] + + for i, c in enumerate(springMap): + # if number of required characters (sum of springlist) + number of required characters between them (length of springList - 1) + # is greater than the remaining length of springMap, then it is impossible that springMap can satisfy the requirements of springList + if sum(springList) + len(springList) - 1 > len(springMap) - i: break + stopIndex = i+springList[0] + if stopIndex > len(springMap): break + if c in ('#', '?'): + subString = springMap[i:stopIndex] + if '.' not in subString and (stopIndex == len(springMap) or springMap[stopIndex] in ('.', '?')): + if len(springList) == 1: + if '#' not in springMap[stopIndex:]: possibilities += 1 + localPrefix += '.' if c == '?' else '#' + else: + possibilities += getPossibleArrangementCount(springMap[stopIndex+1:], springList[1:], localPrefix + subString.replace('?', '#') + '.') # springMap[stopIndex+1:] is to cover the spacer character + localPrefix += '.' if c == '?' else '#' + + if subString[0] == '#': + break + else: + if c == '#': break + else: localPrefix += '.' + else: localPrefix += '.' + + PatternLookup[key] = possibilities + return possibilities + +def getPossibleArrangements(input): + springMap, springList = input.strip().split() + + if not PART_ONE: + springMap = '?'.join([springMap] * 5) + springList = ','.join([springList] * 5) + + springList = [int(c) for c in springList.split(',')] + #if USE_LOGGING: print(f'Checking {springMap} : {springList}') + + subTime = time.time() + possibilities = getPossibleArrangementCount(springMap, springList, '') + subEndTime = time.time() + + if USE_LOGGING: print(f'\t{springMap} has {possibilities} possibilities. Time: {subEndTime - subTime}') + + return possibilities + +startTime = time.time() + +file = 'example.txt' if USE_DEMO else 'input1.txt' +input = getInput(file) +solution = 0 + +with ThreadPoolExecutor() as executor: + results = executor.map(getPossibleArrangements, input) + solution = sum(results) + +endtime = time.time() +print(f'Solution: ', solution) +print ('Completion time: ', endtime - startTime) \ No newline at end of file From cbb7f2563df5394f43ec199a0b480d9476b80686 Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 13 Dec 2023 11:44:32 -0600 Subject: [PATCH 2/6] Day 13 Solution --- TheoreticalHybrid/Day_13/example.txt | 15 + TheoreticalHybrid/Day_13/input1.txt | 1305 ++++++++++++++++++++++++++ TheoreticalHybrid/Day_13/main.py | 111 +++ 3 files changed, 1431 insertions(+) create mode 100644 TheoreticalHybrid/Day_13/example.txt create mode 100644 TheoreticalHybrid/Day_13/input1.txt create mode 100644 TheoreticalHybrid/Day_13/main.py diff --git a/TheoreticalHybrid/Day_13/example.txt b/TheoreticalHybrid/Day_13/example.txt new file mode 100644 index 0000000..f226414 --- /dev/null +++ b/TheoreticalHybrid/Day_13/example.txt @@ -0,0 +1,15 @@ +#.##..##. +..#.##.#. +##......# +##......# +..#.##.#. +..##..##. +#.#.##.#. + +#...##..# +#....#..# +..##..### +#####.##. +#####.##. +..##..### +#....#..# \ No newline at end of file diff --git a/TheoreticalHybrid/Day_13/input1.txt b/TheoreticalHybrid/Day_13/input1.txt new file mode 100644 index 0000000..b718cdf --- /dev/null +++ b/TheoreticalHybrid/Day_13/input1.txt @@ -0,0 +1,1305 @@ +.##...#..## +.....##...# +#..#..###.. +#..#####..# +####.##.##. +####.##.##. +#..#####..# +#..##.###.. +.....##...# +.##...#..## +.##..#.##.# +........### +.....#...#. +....#.#.##. +#..##..###. +#..###..#.# +#..#...#.## + +##....##.#. +##.##.#..#. +..####....# +#######..## +##..#...... +...##...... +###....##.. +..#.#..##.. +...#.#....# +..##....... +..##.#.##.# +##...##..## +######.##.# +###...#..#. +...###....# +..##....... +###.##....# + +.#.#....#.#.### +...#....#...#.. +....####....#.. +.#.######.#..## +###..##..###... +.#...##...#.### +..##....##..... +.#...##...#..## +..##....##..#.. +.##########.... +##.#.##.#.##... +....####.....## +##...##...##.## +##.#.##.#.##.## +...#....#...### +##...##...##### +....#.......... + +######.###.#..# +.....#.####.#.. +.....#.####.#.. +######.###.##.# +.###..#.#....## +.###..#.#....## +######.###.##.# +.....#.####.#.. +.....#.####.#.. +######.###.#..# +.#.#######.##.. +.....#..##.#.#. +###....##.##... +.#..#..#...#### +.#...#..#.#.... + +..#.#....#....# +..#.#....#....# +..##.#..#..##.. +#.#.##.#.#.##.# +####.###.#.##.# +.####.######.## +##.#....#.####. +.####.###.#..#. +#..##...#.#..#. + +###....## +####..### +##.#..#.# +....##... +##.#..#.# +##.####.# +..##..##. +...#..#.. +..##..##. +..######. +####..##. + +..#.###.#...#.. +###.##.#...#### +..#.#..#.....## +..##........##. +...#..#.###.#.. +...#..#.###.#.. +..#.........##. + +.#..##..#.##. +.##.##.##.... +..######..##. +...#..#...... +#.#.##.#.#### +.#..##..##### +.#.#..#.#.... +##.#..#.##..# +..#....#..... + +.##..##.####... +.##..##..#.###. +#..##..#.##.#.# +.######.#..#... +#..##..###...## +#..##..####.#.# +#..##..###.#..# + +.###.#..#.#.#.# +#.##.#..##..#.# +.#.#.##.##..### +.#.#.##.##..### +#.##.#..##..#.# +.#####..#.#.#.# +....#...#.##... +#..##..#..###.. +.#.#.#.####.### +####.#...#..#.# +#.#.#.###.###.. +#.#.#.###.###.. +####.#...#..#.# + +........#..#....# +############..... +#########.##..... +........#..#....# +.######..##..#.#. +.##..##..#..##### +........##..##### +#.#..#.#..#...#.. +#......#.#..#.##. +##....##...##.##. +#.#..#.#.#.##..## + +#..#... +#..#### +####.#. +####.#. +####.#. +####.#. +#..#### +#..#... +.##.### +.##.#.. +####..# +#####.. +...#### +#..##.. +.##.##. +#..#.#. +#..#..# + +.##...##### +....##..##. +##.#..##..# +######..... +####..##### +.##.###.##. +........##. +.....#..##. +.##.#.#.... +....#...... +#..#.#.#..# +.......#..# +.##........ + +#..####.##### +#..##....#### +.##.#.####.## +.##.###..#... +#..#####..#.. +.##.##.#.#... +.##..#.##.... +######..#.#.. +#..#..##.#### +.....#....### +.##...##.#... +#..#.#.#..... +.....#.####.. +#..#...##..## +.....#.####.. +.##.#..###### +.##.........# + +#....#..### +.##.###.#.. +....#...#.. +#.#.##.#... +#.####.#.## +##..#.#.### +##..#.#.### +#.####.#.## +#.#.##.#... +....#...#.. +.##.###.#.. +#....#..### +#.#.#..##.. +.#.##.##..# +####..#.#.. + +#.######### +.#.....#..# +##.#..#.... +##.#..#.... +.#.....#..# +#.######### +###....#... + +#.##.#. +#.####. +..#...# +...#... +.#.#.#. +.#.#.#. +...#... +..#...# +#.####. + +##.#### +######. +######. +######. +######. +..##... +#.##.## +#....#. +#....#. + +#.#.#..#.#.#. +#..#.##.#..#. +.###.##.###.# +...#.##.#...# +...#.##.#...# +.###.##.###.# +#..#.##.#..#. +#.#.#..#.#.#. +...##..##.... +#.#......#.## +##.#.##.#.##. +#..######..#. +.##......##.# +.##.####.##.. +.#.##.###.#.. + +.....#..##.## +.....#..##.## +..#..###...#. +.##..###.#... +#.#.#####.##. +#...###.####. +#..###...###. +...#..####... +###.#.#.#.#.# +##.#.##..#... +####...#..#.# +.#..#####.#.. +.#..#####.#.. +####...#..#.# +##.#.##..#... +###.#.#.#.#.# +.#.#..####... + +#####.##....### +##.##.##....### +##.##.##....### +#####.##....### +.####.#.....#.# +#..#..#...#..## +###...####.#.#. +..####.#.##.#.. +#.#.##...##..## +....##.#.###### +...##..##..#.#. +...#..#.#..###. +#..#.#.#...#.## +.##.#.#..##.##. +...###..##.#..# +####.#.#.#....# +#...#.#..#...## + +..######. +.####.### +..#....#. +#.######. +#.######. +...####.. +...#..#.. +.##....## +.##....## + +.#.#.##...#.# +..#.##.....#. +#...#..#.#### +#...#..#.#### +..#.##....##. +.#.#.##...#.# +..###.#.#...# +.#.#..###.... +.#..###.#.... +..##.#..###.# +##.####.###.. +####...###### +###...##.#.## +###...##.#.## +####...###### +##.####.###.. +..##.#..###.# + +..#....##.# +.....#.#..# +.....#.#..# +..#.....#.# +###..#.#### +.###...##.. +#.###.###.. +###.###.### +###.#..##.. +#.##.###... +#.#.#..#### +.#.#.##..#. +#####.##..# +#.#######.. +#.#######.. +#####.##..# +.#.#.##..#. + +##.##..## +#.##.##.# +##.#..#.# +.#..####. +.#..#..#. +#..###### +.#..#..#. +##..#..#. +.#.###### +#...####. +.##...... +.##...... +#...####. +.#.###### +##..#..#. + +...#....#.... +####....##### +#..#.##....## +#.#..##..#.## +###.#..#.#### +##........### +#..#.##.#..## +.##.####.##.. +.####..####.. + +###..###.######.# +###..####.####.## +........#.#..#.#. +...##...########. +#.####.########## +#..##..###....### +.#....#...##.#... + +...##...####. +#.####.#.##.# +.######.#..#. +#.######....# +........#..#. +########.##.# +########....# +#########..## +.##..##..##.. +#......##..## +.######..##.. +########....# +.######...... +###..######## +##.##.##.##.# + +##..#..##..#. +..#.#......#. +......#..#... +....##....##. +..#.#......#. +...####..#### +##..#..##..#. +......#..#... +......#..#... +###.###..###. +##.#...###..# + +####.#### +.#....... +.#....... +#.##.#### +..#.....# +..#.....# +#.##.#### +.#....... +.#....... +####.#### +..#.#..## +####..... +#.....### + +...#..#...#.. +...#..#...#.. +#.##..##.#..# +....##......# +####..####.## +..######..... +##.####.###.. +#...##...#### +#...##...#.#. +#..#..#..#..# +#.#.##.#####. +..#....#...#. +...####...#.. +#........#.#. +...#..#...#.. +#.#....#.#.#. +#..####..#### + +...###.#...#.## +...###.#...#.## +..##.....#.##.. +#...#....##.#.# +...###......#.# +####.#.#..#.#.. +..##....##.#.#. +.#..###.##..### +##.###.#..##..# +.#.#...##.#...# +...#..###..##.. +#...##.#.###### +###.####.#..... +#..#.#.#.#...#. +#..#.#.#.#...## +###.####.#..... +#...##.#.###### + +##.#.#.##..##.# +##.#####....### +##.#...##..##.. +##.###.##..##.# +.....#.######.# +..##.#..#..#..# +######.#....#.# +..#.....#..#... +##.###...##.... + +####..#.. +#...#...# +###.##.## +##...#.## +.#.#.##.. +.#.#.##.. +##...#.## + +...##....#..# +##....##.#.## +.........#### +########..... +##.##.##.#### +#########..## +#..##..#.#.#. +.........#... +##....####..# +...##.....#.. +........####. +##....##..#.. +########..### + +#.#.#..#. +..##.##.# +..##..#.# +#..####.# +.##.#..#. +.##.#..#. +#..####.# +...#..#.# +..##.##.# +#.#.#..#. +####..### +...#..#.# +####...## +####...## +...#..#.# +####..### +#.#.#..#. + +...######....## +#..#.##.#..#### +###..##..###... +#..#....#..##.. +..##.##.##...## +##.#....#.###.. +.##########.#.. +...######...### +#..##..##..##.. +.#.#.##.#...... +##.##..##.###.. + +....#.. +..#.... +..####. +..#.##. +..#.##. +..####. +..##... +....#.. +##..#.. +##...## +..##### + +....#..#... +##.######.# +##...##...# +..########. +#..#.##.#.. +#.#..##..#. +#.#..##..#. +...#.##.#.. +..########. +##...##...# +##.######.# +....#..#... +#.#......#. +#.########. +..########. +##........# +..##.##.##. + +##.#.#..#.... +#..#....##### +##..##..#.... +##.###.#..##. +##..####.#..# +#.##..##..##. +.#.#.#..#.... +......##.#### +.##.##.###### +####.##..#### +#.##...#..... +#..###.##.... +...###.##.... +#.##...#..... +####.##..#### + +...##..#. +...##.... +###.##.#. +....#.#.. +###.####. +...##..#. +##...##.. +....###.. +....##..# + +#.##..####. +#.#...####. +###....###. +#....###..# +###.#...### +###.#...### +#....###..# +###....###. +#.#...####. +#.##..####. +#.#.#...### +#.#####.#.# +.#..##.#.#. + +..#...#..## +##.####.... +..#.#..#.## +###..##..## +##...#.###. +......##.#. +......##.#. +##...#.#### +###..##..## + +###....####.##. +.##...###.###.# +#.#.##.#.#..##. +##########.#..# +..........###.. +.##....##...... +#...##...##.### +#...##...##.### +.##....##...... + +...####.#..#..# +##..###.##..##. +##..###.##..##. +...####.#..#..# +###.###...#.##. +..#...#....#..# +#...##..#..#..# +..#......###### +#...###...##..# +.#.##..#.###..# +....##.##..##.# + +.#..### +#.#..## +##.#### +#...### +#.##... +..#.#.. +..##..# +##.#... +##.#... + +....#....#..... +..###....###... +#....####....## +##..##..##..### +###..#..#..##.. +#...#....#...## +.#.##.##.##.#.. +######..####### +##..##..##..### +....######..... +###.##..##.#### +..##.####.##... +###.#....#.#### + +#..##..## +..#..##.. +.#.#.##.# +.#.#.##.# +..#..##.. +#..##..## +.##..##.. +##.#.##.# +...###### +..#.####. +###.....# +.####..## +#...####. + +##.###..#..#..# +.#.###..#..#..# +.###.#.#....#.# +.##...########. +.#..#.#......#. +.#.#####.##.### +#..###...##...# +##.#..########. +#..#.###....### + +.###..###.# +#..#..##.#. +.#.#..#.#.# +.###..###.. +.##.##.##.. +#..#..#..#. +#..#..#..#. +.##.##.##.. +.###..###.. + +..#.#####.#.##. +..####.#...#.## +...#..#.####..# +...###.###..### +##.#####....... +##.#####.#..... +...###.###..### + +#...#.####.#. +#...#.####.#. +..##..#..#..# +##.#.##..##.# +..#.#.#..#.#. +#.########### +##..#........ +..#..##..##.. +#.#.#......#. + +...#..#....## +##.#..#.###.. +#.######.#... +#.#.##.#.#### +###....###.## +..........### +...#..#...#.. +#........#... +.########.### +...#..#....## +##..##..##### +.#...#..#..## +##########... + +.#####.######## +#.###..#.#.#### +##.#...##.#.... +##..######..... +..###.#..###..# +...#..#.#...... +.#..#...#..#### +##.......#..... +###.#.#####.... + +..#.##.#. +..#.##.#. +#.###.##. +#..##.... +.#.#..#.# +.#.#.##.# +###.##.#. +####..#.. +..###..#. +#.#...##. +#.#...##. +..###..#. +###...#.. +###.##.#. +.#.#.##.# + +#..##..## +#..##..## +#..#####. +####..#.. +.#....... +.#....... +####..#.. +#..#####. +#.###..## + +.##.#....#.#.#### +.##.#....#...#### +#####.##...###.## +.##..#.##.....### +#####.#.###..#... +####.####.##..##. +.##..#..#.##.#### +.##....##..####.# +.....#..###.#.#.# +....#.#.##..##.#. +....#.#..#.#.#... + +###..##.. +##.#....# +...####.# +##.#....# +..###..## +..#.#..#. +..###..## + +.##..#... +.#.#.##.. +##.#..... +#..####.. +.##.##### +#...##... +#.#.##.## +#.#.##.## +#...##... +###.##### +#..####.. +##.#..... +.#.#.##.. + +....#....#... +..##.####.##. +#....#..#.... +##..##..##.## +...#..##..#.. +#.#.#....#.#. +###.##..##.## +###.##..##.## +#.#.#....#.#. + +.##.#..## +#..###..# +#..#####. +########. +#..#.#.#. +#..#.#.#. +########. +#..#####. +#..####.# + +.#.....####.... +..#..#......#.. +..#.##..##..##. +.##....#..#.... +...####.##.#### +#...##.#..#.##. +#..############ +.#.####....#### +.##....####.... + +#...#.#....#. +#...#.#....#. +#..###.####.# +##..###.##.## +.#.#.#.#..#.# +#...######### +##.#.#.#.##.# +##..#...##... +.#..##.####.# +#.##.######## +...###..##..# +##.##...##... +.#.###.#..#.# + +##......# +#........ +#.#.##.#. +.###..### +###....## +##......# +..#....#. +#.#....#. +##......# +###....## +.###..### +#.#.##.#. +#........ +##......# +..######. +.#.####.# +###.##.## + +#..#.##.#.. +#..#.##.#.. +###.####.## +.##....#.## +#...#..#... +..#.#..#.#. +..##....##. + +.#...## +#.#.##. +..#.#.# +.#..### +##..... +##..... +.#..### +..#.#.# +#.#.##. +.#...## +##..... +##.#..# +..#.##. +##.#... +#..#... + +..##..######. +.###..#....#. +.#.###.#..#.# +#..#...#.##.. +...#.#.####.# +###.#.######. +.......####.. +..#..#......# +########..### +########..### +..#..#......# + +.#..##.#.##.# +.#..#..#.##.# +#.###.#..##.. +..##..#.####. +....####....# +#....#.#....# +.#####..#..#. + +.#.##....##.#.... +##.#.#..#.#.####. +###.#.##.#.###### +.###..##..###..## +#..#.#..#.#..##.. +....##..##....... +.#.##.##.##.#..#. + +..##......##. +..##..##..##. +......##..... +..###.##.###. +..###....###. +###.##..##.#. +###..####..## +###........## +####......### + +#.#....#.#.## +.##..##..##.# +#.#......#.#. +#..#.##.#..#. +.#...##...#.# +##.######.### +###......#### +.....##...... +#..#....#..## +#..#....#..## +.....##...... +###......#### +##.######.### +.#...##...#.# +#..#.##.#..#. + +.#..#..#.#....# +#.##.###......# +.####...#.##.## +......#.##...## +#....###..#.#.. +..##..###.##### +#########..#..# +#########..#..# +..##..##..##### +#....###..#.#.. +......#.##...## +.####...#.##.## +#.##.###......# + +#...### +#..##.# +.#..##. +#.###.. +#.###.. +.#..##. +##.##.# +#...### +###.##. +.#....# +###.... +..#...# +###.### +###.### +..#...# + +##..##### +##..##### +.......#. +##..##... +#.##.#..# +#######.. +.#..#.#.# +#.##.#### +.####.#.. +.......#. +#.#####.# + +##########...#.## +#.##..##.#...#### +#.######.#.####.. +..........#.#.#.. +###.##.####....## +###....####..#### +##.####.##.##..## +####..#######.... +..#.##.#...####.. +####..########.## +...####...###..#. + +#..###..#...#.# +#..###.##...#.# +#..###.##...#.# +#..###..#...#.# +.#.##.##....#.# +.###.#...#.#... +..#....##.#..## +.#.###..#..#### +...####.#...#.# +.#.##..#.#.#..# +#.#.##.#.##.### +.#####.#..##..# +.#.#.##.##.#### + +.######..## +..#..#..### +.#.##.#.### +.#.##.#.#.. +########... +..###....## +#.#..#.#.## +.##..##.... +########.## +########... +.#....#.... + +##..#.### +#...#.### +#....##.. +#....##.. +#...#.### +##..#.### +##...#.#. +...##.##. +.##..#... +####..#.# +#..#..#.# +.#..#.#.. +.#####.## +##..#.#.# +..####.#. +.#.#..... +##..#.### + +...#####.####.### +###..#.#.#..#.#.# +.##...#........#. +.##...#........#. +###..#.#.#..#.#.# +...#####.####.### +..#.....#....#.#. + +#.#.#..#.######.# +.#.......##..##.. +.#.......##..##.. +#.#....#.######.# +...####.#.#..#.#. +#.#..#..########. +....#.#.#..##..#. + +..##... +#.#.#.. +#.#.#.. +..##... +###.#.. +...#### +##.#### +...###. +#...#.. +..##... +.#..### +..#.... +..##.## + +####..... +..#...### +....##.## +#..##.### +.##..#### +#.....#.. +#.#####.. +####...## +####...## +#.#.###.. +#.....#.. + +......#.##.#... +####..######..# +#..####.#..#### +....##..##..##. +.##.#..####..#. +####....##....# +.##.##......##. +.##..########.. +#..#....##....# +.##..##.##.##.. +....#.#....#.#. +.##...#.##.#... +#####.#.##.#.## +#..#.#..##..#.# +.##.....##..... + +###..##.. +.#..##... +.#.#.#.## +...#..### +..##.#... +#..##.... +..#...#.. +..#...#.. +#..##.... +..##.#... +...##.### +.#.#.#.## +.#..##... +###..##.. +#.#..#### + +###.### +.#.##.. +.#.##.. +#.#.... +####.## +#....## +##.#.## +###.#.. +.#.#.## +...#... +.#.#... +###.... +...#... +...#... +###.... +.#..... +...#... + +##...##....## +#....#..##..# +#..###.#..#.# +#...#.##..##. +#..###..##..# +..#..#..##..# +###..#.####.# +#.#.####...## +...#..#.##.#. +##.##.#....#. +.##...#.##.#. +....#.######. +###.....##... +#..########## +....#..#..#.. +......######. +......######. + +.#..... +......# +.####.. +.####.. +#....#. +.####.# +##..### +##..### +.####.# +#....#. +.####.. + +........##... +........#.#.# +...##........ +##########.#. +.##..##..#... +########...## +........#.... +.##..##.#.#.. +#..##..###..# + +#.##...####..#.## +.#..###.###.#..## +.##...#....#...## +.##...#....#...## +.#..###.###.##.## +#.##...####..#.## +#..####..##.##.## +.#...#....##.#.## +.##..###..#####.. + +......### +#..#.#... +.##...### +#..#...## +.##..##.# +####.##.. +.##.##... +.##.#..## +####..... +......### +.##.##.## + +.####...##. +..##....#.. +..##....#.. +.####...##. +..##.....## +########... +..##..#..#. +.......#### +.......#.#. +.####.###.. +#.##.##...# +#######.... +#.##.##...# +.####.####. +#.##.####.# +..#...###.. +#....##..#. + +.#.#..#.#...... +.#.#..#.#...... +##..##.###.#..# +.###.#.....#... +...#.#.##..#..# +...##....##.##. +.#..#....##.##. + +##..#......#..# +###.#..##..#.## +...#.##..##.#.. +..#..######..#. +..#.###..###.#. +...###....###.. +..###.####.###. +....#......#... +##..###..##...# +..##..#..#..##. +..##.#.##.#.##. + +.#..##.#..# +...#..##..# +..#...##..# +..#...##..# +...#..##..# +.#..##.#..# +.#..#..##.. +###.##.##.# +.###.#...#. +###.####... +##.###.#.## +#..#.#..### +.#.##...#.. +#...#.#.##. +...#.#....# +####.#..### +.###.#..### + +#..##.# +####.#. +.#.##.# +#.#.... +#...... +.#.##.# +####.#. +#..##.# +#.#.#.. +#.#.#.. +#..##.# + +.#..##..#.##.#. +...###.#..##..# +.##.....#....#. +...#...###..### +.##.#..#.#..#.# +.##.##.###..#.# +##.##..######## +###....#.#..#.# +.#...##.######. +##.#..#.######. +#.#..##..####.. +######..##..##. +#.#..####....## +#.##.#.#.#..#.# +.#...#..#.##.#. +.#...#..#.##.#. +#.##.#.#.#..#.# + +#....###..... +.#..###..#### +.###...#.#..# +#####.....##. +##.##..###### +#..##..###### +#####.....##. +.###...#.#..# +.#..###..#### +#....###..... +##.####...... +#....##.#.##. +#...#..#.#..# +.##.#..#..##. +......#...##. + +##..##..... +.##.#...### +.##.#...##. +##..##..... +#####.#...# +##.....###. +..#...#...# +..#...#...# +##.....###. +#####.#...# +##..##..... + +..#...##... +...######## +###..####.. +..##..##..# +#..#.####.# +####.####.# +###.#.##.#. +....######. +..#........ + +.....#..#.# +.....#..#.# +..#.##...## +....##.###. +#..#....#.. +..#.#.##.#. +#####.....# +#..#..##### +.###....... +.###....... +##.#..##### +#####.....# +..#.#.##.#. +#..#....#.. +....##.###. +..#.##...## +.....#..#.# \ No newline at end of file diff --git a/TheoreticalHybrid/Day_13/main.py b/TheoreticalHybrid/Day_13/main.py new file mode 100644 index 0000000..7af7d1e --- /dev/null +++ b/TheoreticalHybrid/Day_13/main.py @@ -0,0 +1,111 @@ +import time +from copy import deepcopy + +USE_LOGGING = True +USE_DEMO = False +PART_ONE = False + +def getInput(fileName): + file = open(fileName, 'r') + + input = [[line.strip() for line in block.split('\n')] for block in file.read().split('\n\n')] + + return input + +def rowsOffByOne(row1, row2): + ob1 = False + for j, c in enumerate(row1): + if c != row2[j]: + if ob1: + return False + else: + ob1 = True + + return ob1 + +def checkReflection(pattern, rowNum, allowAdjustments): + # I mixed symbolism here and used left/right instead of higher/lower, my bad + lr, rr = rowNum, rowNum + 1 # initialize lr (left row) and rr (right row) indexes + + p = deepcopy(pattern) + + while lr >= 0 and rr < len(p): # while inside the bounds of the grid + leftPattern, rightPattern = p[lr], p[rr] # get the left and right row values + if leftPattern == rightPattern: # if they match, mvove the indexes out 1 and repeat + lr = lr - 1 + rr += 1 + else: # if they don't match + if allowAdjustments: # if we're allowing adjustments (smudge correction) + if rowsOffByOne(leftPattern, rightPattern): # if they're off by one + p[lr] = rightPattern # set the left pattern to the value of the right pattern + if checkReflection(p, rowNum, False): return True # if this produces a valid grid reflection (disallowing further adjustments) then this is a valid reflection + + p[lr] = leftPattern # reset the left pattern to it's original value + p[rr] = leftPattern # set the right pattern to the value of the left pattern + return checkReflection(p, rowNum, False) # if this produces a valid grid reflection (disallowing further adjustments) then this is a valid reflection, otherwise it is not + else: return False # they're not off by only one, this is an invalid reflection + else: return False # no adjustments allowed, this is an invalid reflection + + return True # Didn't find any disqualifications, therefore it's a valid reflection + +# blockLine represents a disallowed answer and is populated by the part 1 answer for the same grid +def getReflectionLine(pattern, rotate, blockLine): + p = [''.join(list(reversed(x))) for x in zip(*pattern)] if rotate else deepcopy(pattern) + + for i, row in enumerate(p): + if i+1 < len(p): + nextRow = p[i+1] + if row == nextRow: + validReflection = checkReflection(p, i, blockLine is not None and not PART_ONE) # only allow adjustments if blockLine was provided and it's part two + if validReflection and (PART_ONE or blockLine is None or blockLine != i): + return i # if line produces a valid grid reflection and it's either part one or blockline hasn't been provided or blockline isn't the same value as i, then this is the answer + elif blockLine is not None and not PART_ONE: # if blockLine has been provided and it's not part one, then we can check for smudges/adjustments + if rowsOffByOne(row, nextRow): # if the two rows are only off by one character + p[i] = nextRow # set this row to be the same as next row + if checkReflection(p, i, False) and blockLine != i: + return i # if this produces a valid grid reflection and blockline isn't the same value as i, then this is the answer + + p[i] = row # reset this row to it's original value + p[i+1] = row # set next row to be the same as this row + + if checkReflection(p, i, False) and blockLine != i: + return i # if this produces a valid grid reflection and blockline isn't the same value as i, then this is the answer + + p[i+1] = nextRow # reset the next row to it's original value + + return -1 # never found a row that produced a valid reflection + +counter = 0 +def getPatternValue(pattern): + global counter + counter += 1 + + if USE_LOGGING: print(f'Checking pattern {counter}') + hLine = getReflectionLine(pattern, False, None) # part 1 solution - horizontal reflection + if USE_LOGGING: print(f'\thLine: {hLine}') + if hLine >= 0 and PART_ONE: return (hLine + 1) * 100 + + vLine = getReflectionLine(pattern, True, None) # part 1 solution - vertical reflection + if USE_LOGGING: print(f'\tvLine: {vLine}') + if vLine >= 0 and PART_ONE: return vLine + 1 + + if not PART_ONE: + hsLine = getReflectionLine(pattern, False, hLine) # part 2 solution - horizontal reflection + if USE_LOGGING: print(f'\thsLine: {hsLine}') + if hsLine >= 0 and hLine != hsLine: return (hsLine + 1) * 100 + + vsLine = getReflectionLine(pattern, True, vLine) # part 2 solution - vertical reflection + if USE_LOGGING: print(f'\tvsLine: {vsLine}') + if vsLine >= 0 and vLine != vsLine: return vsLine + 1 + + raise ValueError('No reflection line found') + +startTime = time.time() + +file = 'example.txt' if USE_DEMO else 'input1.txt' +input = getInput(file) +solution = sum([getPatternValue(p) for p in input]) + +endtime = time.time() +print(f'Solution: ', solution) +print ('Completion time: ', endtime - startTime) \ No newline at end of file From 000e5f7328f3e4c4c0b2d913b0779f833eb63e00 Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 13 Dec 2023 11:51:19 -0600 Subject: [PATCH 3/6] Comment corrections --- TheoreticalHybrid/Day_13/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TheoreticalHybrid/Day_13/main.py b/TheoreticalHybrid/Day_13/main.py index 7af7d1e..79d373d 100644 --- a/TheoreticalHybrid/Day_13/main.py +++ b/TheoreticalHybrid/Day_13/main.py @@ -31,10 +31,10 @@ def checkReflection(pattern, rowNum, allowAdjustments): while lr >= 0 and rr < len(p): # while inside the bounds of the grid leftPattern, rightPattern = p[lr], p[rr] # get the left and right row values - if leftPattern == rightPattern: # if they match, mvove the indexes out 1 and repeat + if leftPattern == rightPattern: # if they match, move the indexes out 1 and repeat lr = lr - 1 rr += 1 - else: # if they don't match + else: # they don't match if allowAdjustments: # if we're allowing adjustments (smudge correction) if rowsOffByOne(leftPattern, rightPattern): # if they're off by one p[lr] = rightPattern # set the left pattern to the value of the right pattern @@ -42,7 +42,7 @@ def checkReflection(pattern, rowNum, allowAdjustments): p[lr] = leftPattern # reset the left pattern to it's original value p[rr] = leftPattern # set the right pattern to the value of the left pattern - return checkReflection(p, rowNum, False) # if this produces a valid grid reflection (disallowing further adjustments) then this is a valid reflection, otherwise it is not + return checkReflection(p, rowNum, False) # if this produces a valid grid reflection (disallowing further adjustments) then this is a valid reflection, otherwise this is not a valid reflection else: return False # they're not off by only one, this is an invalid reflection else: return False # no adjustments allowed, this is an invalid reflection @@ -63,13 +63,13 @@ def getReflectionLine(pattern, rotate, blockLine): if rowsOffByOne(row, nextRow): # if the two rows are only off by one character p[i] = nextRow # set this row to be the same as next row if checkReflection(p, i, False) and blockLine != i: - return i # if this produces a valid grid reflection and blockline isn't the same value as i, then this is the answer + return i # if this produces a valid grid reflection (disallowing further adjustments) and blockline isn't the same value as i, then this is the answer p[i] = row # reset this row to it's original value p[i+1] = row # set next row to be the same as this row if checkReflection(p, i, False) and blockLine != i: - return i # if this produces a valid grid reflection and blockline isn't the same value as i, then this is the answer + return i # if this produces a valid grid reflection (disallowing further adjustments) and blockline isn't the same value as i, then this is the answer p[i+1] = nextRow # reset the next row to it's original value From 9d7411833e4980997d49fff5d3e65887d1c4cb42 Mon Sep 17 00:00:00 2001 From: Caleb Date: Thu, 14 Dec 2023 15:24:40 -0600 Subject: [PATCH 4/6] Day 14 Solution --- TheoreticalHybrid/Day_14/example.txt | 10 +++ TheoreticalHybrid/Day_14/input1.txt | 100 +++++++++++++++++++++++++++ TheoreticalHybrid/Day_14/main.py | 82 ++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 TheoreticalHybrid/Day_14/example.txt create mode 100644 TheoreticalHybrid/Day_14/input1.txt create mode 100644 TheoreticalHybrid/Day_14/main.py diff --git a/TheoreticalHybrid/Day_14/example.txt b/TheoreticalHybrid/Day_14/example.txt new file mode 100644 index 0000000..b92d1a3 --- /dev/null +++ b/TheoreticalHybrid/Day_14/example.txt @@ -0,0 +1,10 @@ +O....#.... +O.OO#....# +.....##... +OO.#O....O +.O.....O#. +O.#..O.#.# +..O..#O..O +.......O.. +#....###.. +#OO..#.... \ No newline at end of file diff --git a/TheoreticalHybrid/Day_14/input1.txt b/TheoreticalHybrid/Day_14/input1.txt new file mode 100644 index 0000000..91f62e0 --- /dev/null +++ b/TheoreticalHybrid/Day_14/input1.txt @@ -0,0 +1,100 @@ +O...#.O.OOO.OO.O.OOO...........OO#..##...#...#.O.#.O....#.##..#.#.OOO.O....#....O...O..OOOO.O#...... +O#OO....#O....O..#..###....#.#..#.......#..#.#....O...O.#..O.O#.....#.O#...O.O..##..OO.#...O.O#..... +.O...#..#...##....##....O.OO#O....O.O..#O.....#O.O....#.#O#.#O......#O.....#.O..O.....O.....O...O##. +..O...#OO..O....OO.....OOOO#O.OO..#.........O.O........O..#.........##...O.........O#..O.....#O.OO## +OO.O....#O#..O..#.OO....OO.#.OO...##.O..O..O....OO...O....#.....#..O#OO....#....O.....OO.#.O......OO +#....O...O#..O.O...O...#O#O.#....O.##..#..........OO.#....O#O#..O.OOO.O....O.O.O.O#.O..O..O....O..O. +#.O#..O......OO.#.......O......#.#.O..##..OO..##O.#.O.O#...#.....O.#.O.OO#.O.O#...O.O.#....#.#OOO... +#..O.O.O..O.#.#.#..O#OO.O.O...#.......#...#.#....O.....OO..#.....O....#O...#O..##.O.#....O.....O.O#. +.#O..#........OO.OOO..O...O.O..#O#OO.O.#..#..O.....O.OO..O..#...O......O.O##.O.OO.#..O........#..... +.O.O.O........O..#.O.##....#.#.#..OO..#....O.O.O.O.....#.#..O....OO..O#..O###.OO.OO....#..#..O.##O.. +O.O......#..##.O...#O.#OO.#..O..O...O.#OO...O..OO.O.O..OO....O.#.#.O#O#..O.#.#.OOOO..OO.O.O.O.O.#..O +O#.....#OO#....O..#..O##..OO.............#O#OO.##...O.......##......#O....O.#.O......##...........O. +...##.##..#O......#.......#.....#...#O.O.....#...O..O........O...OO.O..#....##....#O....#...O.O....# +..O.....OO.#..#O#.#OO..O.....O.......O.OOO#OOO.....O..O..O#...........##O..O.#...O.OOO..O.##O.#..#.O +.##...OOO.....#.O...#.O......#.O.O....O......#OOO...#..#.#.#.O...O.O.#.O.###.OO##O....O....#.##..#.. +O..#.#.........O#...O...O.##..#....O.#..#O...##.OOOO#O#.......#..#.........#OO.##..#......O.##...... +..#O...#......O.#.OO..#..O..O#....O.....#....O.#.#......####..##OO.O.O..O...#..#....#..#O#..#.#...O. +............O.......O.....O.#O...#.....###......O...#O....#.OO.##.....#.....O..O.O...O......#O#...OO +..#.O#.#.#..O.OO#.#..#.O.#..O.#.O.O...OO..OO.##..#.#O....O.......OO...O.....#..O..#....O.#...#...OO. +OO...#..#.#..O.OO#O#..##...#...O..#...........O.O.OO.O..#...OO.#.O..O#.#O#.O#.O...O..O...#O..#.O.... +..O.O.#....#...#.O.#.O#...##.O#..#O...........O.##...#...#O..O.....#O.#O.....#..##.O..#.O.....#O.O.. +.O..OO.O....#OO#....#.###O#..OO..##..#..##.....O.O.O........O.O.O.O#...O..#O#..O........#.O###..O.#. +O.#...O.O.OO#..##....OO...O.....O.O.#O....#...#....##.#..#OO...O#O....O...O.#O....#..#...OO..O.#.... +..#...O......O#..O.#..#O#.#OO..#O.O..O..#...#........OOO#.OO.....O##O..#..OO.O##..O..#..O.O...O..O.. +...##.#O.###.###...O..#.#O..#..O....O.#O......O.#....O..OOO..O..O..#..O.#.#.....O.#.#...O#.O..O...OO +...O.#....#..O##..#....O..O...O....OO.#.O..#O....#.....#.#........O....O#O.O....O...#.O..#..O.O#OO.O +.##O....#O#O.O.....#.O...........#..O.......#O...###....#O##O...##..OO.#O..#O.O..O.....#.OO#O..#O... +O.O..........O.#..OO.#...O.O..#..........#......O.......#..#O#...#O..##...O...O#.O..........##...#O. +..#..O..O..#O....O.O...#.O..O.#..O#O...O.#......O.#O..#O#....O#..#....##.#.O.#..##.....#.#.#.....O.# +.O##..#.#O.OOO...O.O..OOO..O..#.O..#..#..OO#..OO...O..O..O.O#O.#.....#O.#.#...#O#.O.O.OO..O.......#. +O..O#.OO.#O..O.##..O..OO#.O.....O.O..##....#O...#..#.#O.#O.O#..O...O.#OO#O.O..#.......O.......O..... +..#.#.##O...#.O.O..O...OO.....O#.....O.#...#O.#O.#....##O.....OOO.O..OO....O.O..##....O.O..#.....O.# +.....#.OO.O....O##..##..O...#......#..#..O..O...#O...#............O.#.......#O.O#......##.O.O.#....# +...#O#.#O.##..#.#...O.O...#..........O.O#....O.O..###.#..O...#.#OOO....OO.O.O#O##........#..O.O...O. +..OOO.O..O#..O#OO.#....O.............#....##.#O...O...O##.O..O..##.....O#....#O#...O.O#.O.#..OOO...# +.#.#..O.O.....#O#.....OO#..O.O..O.O............O..#.#.#.#......####.#O#..#..OO.O.OO#..O#.##....O#..O +........##O.#.......OO......O.OO.##..#..O......O#O...#...O.#......#OO..........O..OO...##..#..O.O.O. +..O#.O...#..O..O.##.....O..##....#...O..#.O..#..O.#.OO...###...#..O..O#..O.O..#.#....O#..#.#......O# +...#..#.#.#..#O..OO#..O.O#...........O.........#.O.OO..#.......O#....O.....#OO.....OO..OO...O.O.O.#. +...O#O......#...O...O..#.O.O#.#O.#....#.OO#.....O.O.#...O.#....O.#...#..O#..#..OOO.O..O.....O#....#O +..O..OO...O..#.#.O..#..#.O.#.O##O..OO..O........#....O##...#....#.#O.#..#......#....#.......O....... +#.........#.O#......OO............O.#......OO.O.#.OO.#..OO..O.##........#O#..OO.#...#.#.O.OO.#.O..#. +...O...#O...O....#..O#O#......#..OO#.O##OOO.#..#O.O#..O...O......O#......OOO..#...#O..OO#........... +.#.#..O#..O......#...O....OOO..#..........O....#..##..#...OO#...O.#.O.#.O......#....O##O..#OOO...... +...O.##...#..O.......#.#.O..O..#.O.....OOOOOOO...#.....O.....#.....O...OOO.##...O#.OO.OO.#...#O#O... +....#.O..#.O.O..O..O#..O.#.......#....#.#....O.....O#....O##O..O..##.O#..OOO#..O.......#.O..O#OO..O. +##.O.............#.#....O...O.......#O#.....OO#O......O..#.......#.#..#...#.......O.O..O....O.#....# +..O..#O..#...#.........O..#.....O.O.#.....O..#..#O....O..O.....##.#...O..O.#..OO#O#...####.O.......# +.O#.#O#..O#...#.O......OOO.O.#..O.O#.#....####......##.O.O.#...#..#O..O........O.....#........O..#.. +.O..O#....O.....O#.O.OOOO##.O..#OO.........##.O.##O...#O...#.O#OO##.....O....O###....###.#.........O +...O##O...O.O..........O#...O#.O...#O..O..##...O#.....O#.O....O...O#.##...#........OOO.O#....OO..### +O.O.O.....O.O..O....O#.OO.O.....O...#..#O#OO...OO..OO.O....#.O.OO....#..O.#O...O...#O#.O#...#.....OO +....#.....##.O#O..#O...OO...O#.#O..#.........OO..#......O..####OOO#...O#.............#.O....O.O..#OO +##O..O.O......O......OOOO..OO##..O........O.....O..O#..OO.O#.O#O#OO#O#..O.O.#..O...O.O.O......##.... +..O.O.#..#.O...#.........O..###.#O..O.#..#......#...O##......O.#.O.O##.....O#..........O..O.....O.#. +....#...O.#...#.#.#.#.O.....O.OO#..O...O#..OOO.OO..O.#.........O.......OO..O..#.#...........#....... +O##...#......#OO..O...O..#O.#OO.##.O.O....#.....O.O.....#O.#....#....O.#.OO..##............#O...O.#. +.OO..##....#.OOO...O.O....O..O.........##..O#.O.OO.....#..OO#....O.O#.#..O.OOO...#.....O#...O.O..O.O +O.O...OO#...O.....O..#.O.........O.O.#...OO....#..O.O..OOO.O..#.O.#.##O#.#OOO.#..#O..O............#. +#..O.O..OO.#O.....#.O.#..O.........#.OO..##.O....#O..OO.O.O.O#.O...OO...O..O.O.O.#..O.....#.O....... +O##..O...##....#O..........O..#..O..O.#.#..O..#.O....#OO......##OOO.##......##.....O.#.........#.... +..#.....#O..O.O......O..#.......#.OO#.....#.O.....O...O.....O#.......#.....#O...O#.#O.###..O.O..##.O +..O.OO.OO...OO.#.......#....#..#O............O.........O....#OO..O...##..O.O..O..OO..##.........O..O +#...O..#O.O..#O..O...#.O.#......O#....#.....O.##..OOO.....O...O.OO#......O...O..O.###OO...#OO.O.OO.# +O#..O....#O.....O#....O..#.O.###..O.OO.#....#...#.O..#O...O.O..O.O........O..#O.O.O..OOO.O..OO..O.#O +#O#.O....#..#......#.#........O...#......#..#.O........O..O.....#............O#..#O#OO#....O.OOOO#.O +...OOO.O........#..O...........#..#O...#.#OOO#....OO.O....#...##.#...#O...#.....OO.#...O..##.O....O. +O.O......#..#.#...OO..##O#..#O.OOO##...O.#O.......O....OOOO.O..O....#.OO#.O...#..O..O.#....#...O..#O +...O..OOO.#OO..O..#O.#O.O#.O..O....#OO.#..O.O.O.....##O...O.......#O..........##...#............O..# +...O.#......O##......#..#............#O#..O......##.#O.O.#OO....O.#..O...O.....O.O....#O.O.O##.#.... +...OO......O#...#.O.#....O.OO.O.##.O..O......#.O.O.O...#O.O.O.O.....##....#...##...#....#OO..#OO#.## +....O....##..##.#.OO....##.....#.....O.O..OO..O...##...#..O##.##......OO.O...OO...OOO..O...##.#.#.O. +#.....O..O.....#.......#.O...........OO..O..O..#......O#.#.OO....#........#..#O.#O#...#..#OOO......O +.O###OO.O##......OO...##O....#..#.....##..#.#OO....#.O.O...#......O....#..O.O..O#O#.###......O....#. +.O..#OO...O#O.....O...#O.O..O..O..##.O..O#.O#.OO..O..O#....O.O.O...OO#....O....O.OOO.O....O...#.##.. +.O........OO...#.OOO..O.#O.##..#..........O..........#.O...OO#.#..O.#O##O...#.....#O#.O#.......#.... +OO.O.......##..O#OO...#.#.#.#.O..O......#..#OO.#...O............#.#.#.##....O.O..#...OO#.##..#O..O.. +O..OO.....#..##.O.#O.....O.O.#...O#.#...#O.OO...O.O..#.##O..OO#..O...##..OO#..O##...O.....#.#..O#.OO +.O...#..#O#..OOO..O#.O#..#O...O.O#.....#...........O.##....O..O...#.OO............O.O#.....#O.O#..O. +..O.O.........#O...#...#..O#.#...#OO##..O#...#.OO#O....OO.O#O......OO...O#O.O....O#O..O#........O..O +#...O....OO.O#..#.#......#.....O#...O.#.O..O...#..O.O..O.O.#OO.O....#....#.......O......O...#.#..#.. +.O..OO.O.#O....##O#..O.#O.#.#..#....##.#O...#.O......#.OO#...#O...O.#...O.OO.#.O.#.O...O....#...#... +..OO......O.O....O#..O..##.###.....O.#..##.#.O......O...#...#..O...O.O.#....#.#...O.O.#........#.#.. +#...#..#.......#.O.O..#..OO..O.O..OOO.O..O..#......O..O..#OO##....O.#.#.O#O#..O#.##.O...#..#.O....#. +#.O#O.O.OOOO#...#..O#..#O#O..#....O...#.OO.#.###.O.......OO.O..O..OOO.#O.O.........#...#.O..O..O...# +.#.O..##..O...O....O......OO.............O.....OO#O..#.....#.OOO##O.OO........#..#.##..OO..........O +OOOOO....#O.O......O.#O#...#...#.#.#OO.O.#..O..##...##...O.....O...O...O##O..O.#O..O#.O...O.O...OOO. +.O..#..#.#..O.O.##O....#......O#.OOO..O....#O.#.###O.#.#.OO.O.#.OO.........#....#..OO.O.O.O##.#.##.. +#O...O..O..O.O.O..........#.#...#O.O......O.O#...OO...#..O..O.....OO...#....#.##......O.........OO.O +..O..##..O.....O.O.....O.O.....O.O...##...O.......#...OO...#..O...#OO.O..#OO..#...#....OO###.O.....O +#...O......#.OO.....O......###..#...#...#.#.....OO#.#.O#..#......O....O.O...#..O#O#..##....#...#.... +..O..#O...#.......O##..#.....O#..O#...OO.#..#.O.O..O..O#.#.OO.O.#..O..O..##...#.O....OO#O........... +.###.O.....#...#......#..#.....#..#....#..O.O....O.#..#..#O#.......#.O.O.....OO#.O...#OO.#..OO#..... +.#.....O...#O.........#....##.O......O.OO##...#.....#..#..O##.#...#..O..#O.O..#O...O..O.O...O.....O. +.#....##....O....O..OO....OO..#..#..OO...O..#.O.O..#..O###.O...#O.#.O.O.O.OO........###....OOO.....# +#.#..O..#.O#...#O.....#..O#.OO..O.#..OOO..O..#...O..O......O..#........#.#O#..O..O#OO.##.#.#.....#.O +......#.#.....O#....OO#...O#.#.O.O#.....O...##..###.....O#.....#..OO#.......OO....#...#.O......O.... +.........O.#........O...O#.#....O..#..O#OOO..#...O.O.....#.#OO.O.OO......#.....OO#O...O...#...#O..OO +..O#..OO.OO#..O##.O..O.##O....#..O##.......#..O........#.O......#....#O..OOO#..OO.O...#...##O.O...OO +..#.....OOO..O.#O#.O##..##..O#.##..OO...#..O..O..#.OOO...O..O.#..O#..#.OO#..O.OO...OOO..O...O..#.... \ No newline at end of file diff --git a/TheoreticalHybrid/Day_14/main.py b/TheoreticalHybrid/Day_14/main.py new file mode 100644 index 0000000..4b861d0 --- /dev/null +++ b/TheoreticalHybrid/Day_14/main.py @@ -0,0 +1,82 @@ +import time +import re +from copy import deepcopy +from collections import deque + +USE_LOGGING = False +USE_DEMO = False +PART_ONE = False + +def getInput(fileName): + file = open(fileName, 'r') + + input = [line.strip() for line in file.readlines()] + + if USE_LOGGING: + for line in input: print(line) + + return input + +def rotateGrid(grid): + return [''.join(list(reversed(x))) for x in zip(*grid)] # rotate it 90 degrees + +def getLoad(grid, spinCount): + counter = 0 + + gridHistory = [deepcopy(grid)] + + compass = deque(['E', 'N', 'W', 'S']) # First element indicates what direction the right side of a row represents + while counter < spinCount: + grid = rotateGrid(grid) + + compass.rotate(-1) + counter += 1 + if USE_LOGGING: print(counter) + + newGrid = [] + for row in grid: + shifted = '' + for sub in re.split('(#)', row): # split on the # character, but keeping the # character + shifted += '#' if sub == '#' else ''.join(sorted(sub)) # if not #, then sort. This changes O..O.O to ...OOO + newGrid.append(shifted) + + grid = newGrid + + for j,g in enumerate(gridHistory): + foundMatch = True + for i,r in enumerate(grid): + if r != g[i]: + foundMatch = False + break + if foundMatch: + #print(f'FOUND A GRID MATCH ({j}) AFTER {counter} SPINS') + cycle = counter - j # determines the size of the cycle + eq = (spinCount - j) % cycle # Determines how far past the cycle reset point is the spinCount value + scGridIx = j + eq # The starting index of the cycle (j) + the spinCount offset (eq) will give us the matching grid for iteration spinCount + compass.rotate(-1 * (counter - scGridIx)) # rotate the compass to match what direction the grid would be facing at iteration spinCount + grid = gridHistory[scGridIx] # set the grid to what it would be at iteration spinCount + counter = spinCount # short circuit the while loop + break + + gridHistory.append(deepcopy(newGrid)) + + while compass[0] != 'N': + grid = rotateGrid(grid) + compass.rotate(-1) + + load = 0 + for row in grid: + if USE_LOGGING: print(row) + load += sum([i+1 for i, c in enumerate(row) if c == 'O']) # calculates the total load on the north beams + + return load + +startTime = time.time() + +file = 'example.txt' if USE_DEMO else 'input1.txt' +input = getInput(file) +solution = getLoad(input, 1 if PART_ONE else 4000000000) + +endtime = time.time() +print(f'Solution: ', solution) +print ('Completion time: ', endtime - startTime) \ No newline at end of file From a7c30481d525ac26916614e0906afaa5fa071fe4 Mon Sep 17 00:00:00 2001 From: Caleb Date: Fri, 15 Dec 2023 13:30:06 -0600 Subject: [PATCH 5/6] Day 15 Solution --- TheoreticalHybrid/Day_15/example.txt | 1 + TheoreticalHybrid/Day_15/input1.txt | 1 + TheoreticalHybrid/Day_15/main.py | 58 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 TheoreticalHybrid/Day_15/example.txt create mode 100644 TheoreticalHybrid/Day_15/input1.txt create mode 100644 TheoreticalHybrid/Day_15/main.py diff --git a/TheoreticalHybrid/Day_15/example.txt b/TheoreticalHybrid/Day_15/example.txt new file mode 100644 index 0000000..62f7ed0 --- /dev/null +++ b/TheoreticalHybrid/Day_15/example.txt @@ -0,0 +1 @@ +rn=1,cm-,qp=3,cm=2,qp-,pc=4,ot=9,ab=5,pc-,pc=6,ot=7 \ No newline at end of file diff --git a/TheoreticalHybrid/Day_15/input1.txt b/TheoreticalHybrid/Day_15/input1.txt new file mode 100644 index 0000000..96a6acb --- /dev/null +++ b/TheoreticalHybrid/Day_15/input1.txt @@ -0,0 +1 @@ +slvc=3,zgg=7,nvzbz=8,mdfh-,gp=3,hqk=9,dmmj=9,nrb=9,mdczr-,nt-,vdd-,smdjr-,zhr=2,kqxjp-,nqzc-,ngqz=2,clpb-,bhfzlm=7,mcs-,hpkmx-,mrsmjc=7,zq-,hfxb=8,nz-,vg-,rlpdk-,kng-,zsg-,jpxg-,hkn-,fjx=8,hcvb=3,jt-,tx=4,njx=1,jssg-,nqzc=4,psl=1,np=7,rmss-,qf-,psl-,cpc=8,bb=6,tkcf-,ckrkz-,vl=5,pj=6,ftxrn-,nj=9,qf-,bnc-,lvxn=6,fkv=7,pbfp-,shgj=8,kjb-,tqcf=1,xzm-,pljq-,gppq-,mdgbg-,mnbfp-,zptxmm-,zxdm-,trp-,mcs=8,sxl=1,gxg-,jvd-,zjc=6,gmn=2,lbjk=7,lp-,hht-,mvjrt=7,nrfg=7,nn-,czp=1,rbjqlt-,drl-,jvd=1,rlpdk-,hdj-,dh=3,nv=8,hdj=1,pv-,rj=6,kf-,nb=8,flz=2,qhhv-,gsf=9,zzk-,zdp-,nmgx=3,ztm=3,blb-,scnq=4,pb-,lbjk=8,lx-,rbdk-,tj-,hdj=1,rc-,nl=5,qfj=5,chzb-,hpkmx=6,llhk=5,nrdh-,pt=5,szb-,qd=3,mnbfp-,lxk-,bvh-,tj=7,ms-,pdnf=8,mdczr=9,smdjr=2,gsnn=5,dcx=9,tblcg-,mrlq-,qtt=2,chlr=7,jj=9,dnnd-,bpr-,zkkmvc=3,qk-,dnr-,slq=1,lnqb=7,rtztm=8,vl-,dnr-,sxl=1,fkv=1,zd-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ql=9,ztm-,qsb-,mmm=9,gknt=1,nt-,cqz=3,qhv=8,drl=8,jvl=1,hcr-,pdnf-,jvl-,hk=4,jrczch-,kjb=7,pj=2,jn=1,vdd=9,bf-,hb=4,gbr=8,djk=8,qqhpqb=5,mt-,pq=4,fvp-,tm-,kv-,clpb-,vtn-,vkc=1,htz-,zdq=3,llckfv-,vsvft-,qf=9,jbn=4,jssg-,dcxz=5,lxk=4,kpf-,jql-,mkg-,cmn-,cgc=6,bgrb-,msp=5,vsfg=4,nbgv=9,xrx-,tnq-,jp=1,zqhj=9,jf=7,dd=6,zpz-,gmn-,xq=5,tnq-,phz=3,vb-,ddlczm=5,zrg-,jj-,shfd-,vv=3,shfd=3,bgc-,jlv-,sdx-,zkkmvc-,sqv=3,bgc=9,trp=8,xfs-,cds=6,zst=3,vbp=3,vst=7,tp-,shfd=7,vr-,vcp=9,zfrjv=6,zzk-,smdjr=6,ddlczm=2,zhr=9,zg-,qrncp=4,vdd-,vhvv-,nbr=3,jbn-,ksc-,rf-,bzx-,hvsjk=9,rrm=3,drl=1,nmgx-,vp=8,ctb-,fzj-,xxrv=7,cqz=5,cj-,bvh=3,fgjkrz=8,qf=7,hgfq=3,rbh=2,cxz-,xdd=7,xhb=7,jjzkb=8,bx=8,nv-,lmv-,vv=9,ptl-,skz=7,mrlq-,qbmbm-,dgh-,kjs-,nl-,sqv=7,bf-,xtkc=9,qm-,fl=6,tq=1,cmn=6,sz=2,rbdk-,blb=9,lrxhxk=4,rd-,qrncp=6,tnq-,pgkfj-,nvzbz=8,nz-,hl=9,lbxp=5,sqv=7,rj=6,kpf-,bfz-,cj=8,br-,pxzn=8,ftxrn=9,fhr-,kmpv=8,cxp-,ffvv=5,sk=7,rj-,jzb-,zjnp=2,mz- diff --git a/TheoreticalHybrid/Day_15/main.py b/TheoreticalHybrid/Day_15/main.py new file mode 100644 index 0000000..cb0c6b6 --- /dev/null +++ b/TheoreticalHybrid/Day_15/main.py @@ -0,0 +1,58 @@ +import time + +USE_LOGGING = False +USE_DEMO = False +PART_ONE = False + +def getInput(fileName): + file = open(fileName, 'r') + + input = [step.strip() for step in file.read().split(',')] + + if USE_LOGGING: + for step in input: print(step) + + return input + +def hashAlgorithm(input): + value = 0 + + for c in input: + value = ((value + ord(c)) * 17) % 256 + + return value + +def hashMapAlgorithm(input): + boxes = [[] for i in range(256)] + + for step in input: + key, value = None, None + if step[-1] == '-': key = step[:-1] + else: key, value = step.split('=') + + keyHash = hashAlgorithm(key) + boxValues = boxes[keyHash] + existingLens = next((l for l in boxValues if l[0] == key), None) + if value is None: + if existingLens is not None: boxValues.remove(existingLens) + else: + if existingLens is not None: + boxValues[boxValues.index(existingLens)] = (key, value) + else: boxValues.append((key, value)) + + focusPower = 0 + for i, b in enumerate(boxes): + for j, l in enumerate(b): + focusPower += (i+1)*(j+1)*int(l[1]) + + return focusPower + +startTime = time.time() + +file = 'example.txt' if USE_DEMO else 'input1.txt' +input = getInput(file) +solution = sum(hashAlgorithm(step) for step in input) if PART_ONE else hashMapAlgorithm(input) + +endtime = time.time() +print(f'Solution: ', solution) +print ('Completion time: ', endtime - startTime) \ No newline at end of file From 23029953f88f1efd4e658c8ece74413d74814e01 Mon Sep 17 00:00:00 2001 From: Caleb Date: Sat, 16 Dec 2023 11:33:03 -0600 Subject: [PATCH 6/6] Day 16 Solution --- TheoreticalHybrid/Day_16/example.txt | 10 +++ TheoreticalHybrid/Day_16/input1.txt | 110 ++++++++++++++++++++++++ TheoreticalHybrid/Day_16/main.py | 121 +++++++++++++++++++++++++++ 3 files changed, 241 insertions(+) create mode 100644 TheoreticalHybrid/Day_16/example.txt create mode 100644 TheoreticalHybrid/Day_16/input1.txt create mode 100644 TheoreticalHybrid/Day_16/main.py diff --git a/TheoreticalHybrid/Day_16/example.txt b/TheoreticalHybrid/Day_16/example.txt new file mode 100644 index 0000000..c78b2e7 --- /dev/null +++ b/TheoreticalHybrid/Day_16/example.txt @@ -0,0 +1,10 @@ +.|...\.... +|.-.\..... +.....|-... +........|. +.......... +.........\ +..../.\\.. +.-.-/..|.. +.|....-|.\ +..//.|.... \ No newline at end of file diff --git a/TheoreticalHybrid/Day_16/input1.txt b/TheoreticalHybrid/Day_16/input1.txt new file mode 100644 index 0000000..f1c5a7b --- /dev/null +++ b/TheoreticalHybrid/Day_16/input1.txt @@ -0,0 +1,110 @@ +\|.................................../....\\/........................-.....|.|..-.....|\...................../ +|-.....|...\........|........................../-...../...--.|..\..........|......./.......-......|......./.-. +.....\..../......-......|.........................-............|..../.....|.......-........../................ +........\..|.....|................/.......-\..............\...../....|............\....\...................... +-................\....-..........-................./.......//...............|..|...................-.......... +...................|..................................|.....|.....-....................../....|..\...\..\.|-.. +.......-.............../......\...................................-......../.......-.\|.................../... +......\..................\.............-..........././....|-.....|......................../.-.....|......\.... +......-............-..................|..................../......-...|.....................\................. +.........\..........-.......-./...-.../..\...../............................|................/....|........... +.\....../....|...............|..../.......................-...................................-......|..\..... +......................../...|.|........|.........|.....................-............../.-.../.-............... +..|..-.-......|.......\....................-|.......|............-............................................ +.........................|.............-..........................-.\\......|.......|........-.........\...... +.../....-....\............/...................|........./..\.......\...........||.|......\.......\..-./....... +.../..\.|..-....../.......................-.......-.......|/...........-.......-.......\...................... +..\...........-...-.......-.........|\....................../.-...........................\...........-....... +..../.....||.....................-.........................................../............././................ +...................-..\................\................................................../.../.........../... +\..................-.-..........//....|......./........-.............../.........\............................ +................/...|................../......./..............|.....|..............|..-...........|........... +..../........-......\.|...-................./...................../|.........\................................ +...../...................-........|.......................-...\.............................\.../............. +...../....-......................./..........................-............-........\......-.....\.../.\.\..... +..|......-.\..........\........................\........../.........|...|............./............../-....... +./..\-.......|.........|.\/........-........|.|...|..|....\...|.\.....|..|..-...............\................. +..|../..........\................./...\...........|.....................-\..................-..|.........-..-. +........./......||.....................................|..\.-|-................//..|-...|............-.\...... +........\..........\..........\......................./......................./......|........-.......|...-... +.........././.....-...-..................-.|..........................-.............-......................./. +.\..........|...........--....................\...-.\.........\......-.................../....|./..\.......... +......\.........\.|..||.....|...../........-..........|....|.....|....\..|..........\.........|............... +...........\....-.../......-............/.............-......../.-...................-....|.....-\.......|.... +/.....................-.../...............-./....................../|....|.-...|.................\......../... +................../.............|..........\..|..\....|....-...../...-.......\../......\....-...../.||........ +./-|.......\..../........../-....../......./...-....-................|............|.................-..../.... +.....................\....................|\.-../.......................|.......|.....-........-./..|......... +..........|...\......\......................|./...........--................-..........-.......\...\-..\|.\..\ +.......\...-|................\....|......................../............................\..........-.\........ +./.......|................\...\........./.........|..................|.....-.......-.....|..|-............-... +...|............/....-.\...........\...../..|..-...../..|.......-........\...-..............-................. +.\-.....................-.........-.\.................|....-.....\....\.\\.//|.........\../.\.........../..-.. +......................................|\-........../..-.........-.........................................-|.. +........./.../..|.....-............./..\............./............../..............-\.......|....-....-....... +.|............|......-/.-......-......-............-........|...../......\/....\../........|.......|.......... +.......|...........\.................-......................\..-...........................|.................. +|.........\..\.....-.../.........................-\.................|.........\............................... +....-..........\.....././.............../..........-|...|...../........................-......|....-.......... +....................\.|.........\....|..........-.............\..........................|...........\........ +.............|.../......|.........../....................../....-..................../......................./ +.\...|....-../.............|............-..-.......||..........|............\/..................\...-......... +........\/....-...................../..............-.....................-................................-... +/-..........-......\.....|.....\....\............./..../...........|........-....\...............\.........|.. +...../..................\........................./.-...../.....\....-..-\.....\...|................./........ +......../......./.......................-.......-..\//...........-|.............../...\.\./..\................ +..............................|...................../......\..|.............\\......................./..-..... +....\.....|..............|..................|...|.............|............--.......-..-.................../.. +....|.............../.\.............................................|...................../.........\......... +.........\...../.../......\....................................................|.....-.../...\..........\..... +-\............\.......................-...................-..../-........./.................................-. +|.....\.....................\...................|..|..\....../.......\...|......\.............../-.-......|... +.......|.........\.................|..-.............................\............................/............ +........................-.-........./..../.|.|.../..............\../....-..........|............../.....\\.... +...........\-...........||..........................................\.........|...........-...-...........-\.. +..................|................................./.................||.|..........|.....................|.|. +....../.............................|.............................-/..|......./............................../ +./................../.|................................-...\.......|..................|............\-..|.....| +\.....|.-...........-|.................../............\................../......................./.......\.... +.\.....................\.............|...............-......\...-........-...............-..........|../...... +.../..\...|........\\....\............-..|.....|........-/..........|....|.........\..|/...-.....-.\.../.....\ +......................../....-................................\..|.........................\.................. +..................\....-............\\\/..........|.................|...../..|.............|.................. +..|./.......|.....-............|...............|....|............-...\...........................\.\.......... +.....|-..\...\.........................|../...................../......\............\......................... +-..-...........-............|......../................./......\.....-...|...............|..................... +........|.......|.......\.|...\...../..\.../......................\.......\...\..................\....-..../.. +....-.-./.|...............-.-.............-.............../......./..........|.|../...............|.-......... +...........\..-............../..........-..-../........../.....-/-|.........................-.............\... +............................\.......//.|......../...........|\.....\...........-..-.......-/-................. +..................................\..-..........|./..................../\............./............../........ +.....\..........\.......-............/.....................-.|....-......................./.|................. +...............................|.......\........../.............-.....|.......\..\........................-... +......\.........\\............../..-..............\...|..--......-.....\......./................./............ +.\.......\.....-...........-......................\........................../......../..../.-./..\........../ +.......|.......|........|...\\................./..../..\....\...\...........-.....................\.........-/ +....../........................................\..........-..|...............\....................|...-....... +.|.|......./..........\........|......-......-............................|..|..\.........\.......-........... +.....\.\-.-......\.........../.......\\..|..\........\/....\|.............................................\... +.....................-.......................|............................................../................. +..................\...-|............|........................-....../...........||............................ +........./............................./.....-....../.-...........-........................................... +.........|...........-.........\......\.............\-.....|...-...|-.../..|.............\.....|....-......... +.....|.....................................|.../........./|...|.|..................\.......................... +..\...........-.............|................//.............|........|.........../.\..............\........... +..-\..-............|.\............../../.....||.../......-......|...-/...|..../../...................-/.\..... +.......\.........../.\......\.........\...........-..............\..............|.........-..........-.-...... +../...................\|............................../...................|.............../.............-/.... +................/\.................|.....................\...|.\....................-.....-................... +......................................................|................................\..\../...|.......|.-./ +.........//..|.......\.-...............|............................................................-.|....... +........../.\........\............-./.\....../..//...........\..........|.\.\...|/\...-...\................... +...-................/............../.............................................-../.-........\........../... +...................-...............-.....-............/................./|.-.|...\.\...............-..-......| +\....../.....|......\.........|../.....|......-..../....................-................/...\......\....../.. +...../...-.......................\..|\...-...\.|.........|.......|.................\.............-............ +...........................\/............................../...........-.......-..../......../......\...-..... +.............................|.-......................-|\...--...............................\..............\. +..............\.|......./..........\..........\/.../......|.....-../......../.....\...|-...........\........./ +.............../........\...................../...|......................-...|.|......./.....-................ +..-...............--..-...-............-..-\......................-.......|..............|........\.\.....-... \ No newline at end of file diff --git a/TheoreticalHybrid/Day_16/main.py b/TheoreticalHybrid/Day_16/main.py new file mode 100644 index 0000000..0b0561f --- /dev/null +++ b/TheoreticalHybrid/Day_16/main.py @@ -0,0 +1,121 @@ +import time + +USE_LOGGING = False +USE_DEMO = False +PART_ONE = False + +EnergyMap = None +EnergyCounter = 0 + +def reset(input): + global EnergyMap + global EnergyCounter + # Set up the energy map to be a grid of equal size with every element being an empty list. This will store every direction a beam has traveled on that tile. + # This is to detect loops + EnergyMap = [[[] for j in range(len(input[0]))] for i in range(len(input))] + EnergyCounter = 0 + +def getInput(fileName): + file = open(fileName, 'r') + + input = [[c for c in line.strip().replace('\\', 'b')] for line in file.readlines()] # replacing \ with b for backslash for the sake of more readable output + reset(input) + + if USE_LOGGING: + for step in input: print(step) + + return input + +def energize(input, startingTile, direction): + global EnergyMap + global EnergyCounter + + x,y = startingTile + splitList = [] + + while 0 <= x < len(input[0]) and 0 <= y < len(input): + tile = EnergyMap[y][x] + if not tile: # if list is empty + EnergyCounter += 1 + tile.append(direction) + elif direction in tile: + break # found a loop + else: + tile.append(direction) + + tileChar = input[y][x] + if tileChar == '.': + if direction in ('r', 'l'): + x = x + 1 if direction == 'r' else x - 1 + else: + y = y + 1 if direction == 'd' else y - 1 + elif tileChar == '|': + if direction in ('r', 'l'): + splitList.append(((x, y-1), 'u')) # add the up split to the queue to be parsed later + # Continue this iteration going down + y += 1 + direction = 'd' + else: + y = y + 1 if direction == 'd' else y - 1 + elif tileChar == '-': + if direction in ('r', 'l'): + x = x + 1 if direction == 'r' else x - 1 + else: + splitList.append(((x-1, y), 'l')) # add the left split to the queue to be parsed later + # Continue this iteration going right + x += 1 + direction = 'r' + elif tileChar in ('/', 'b'): + slashChar = tileChar == '/' + match direction: + case 'r': + y = y - 1 if slashChar else y + 1 + direction = 'u' if slashChar else 'd' + case 'l': + y = y + 1 if slashChar else y - 1 + direction = 'd' if slashChar else 'u' + case 'u': + x = x + 1 if slashChar else x - 1 + direction = 'r' if slashChar else 'l' + case 'd': + x = x - 1 if slashChar else x + 1 + direction = 'l' if slashChar else 'r' + + for s,d in splitList: + energize(input, s, d) + +startTime = time.time() + +file = 'example.txt' if USE_DEMO else 'input1.txt' +input = getInput(file) + +solution = 0 + +if PART_ONE: + energize(input, (0,0), 'r') + solution = EnergyCounter +else: + maximumEffort = 0 + xRange = len(input[0]) + yRange = len(input) + + for y in range(yRange): + energize(input, (0,y), 'r') # come in from the left side of the grid + maximumEffort = max(maximumEffort, EnergyCounter) + reset(input) + energize(input, (xRange, y), 'l') # come in from the right side of the grid + maximumEffort = max(maximumEffort, EnergyCounter) + reset(input) + + for x in range(xRange): + energize(input, (x,0), 'd') # come in from the top of the grid + maximumEffort = max(maximumEffort, EnergyCounter) + reset(input) + energize(input, (x, yRange), 'u') # come in from the bottom of the grid + maximumEffort = max(maximumEffort, EnergyCounter) + + solution = maximumEffort + +endtime = time.time() +print(f'Solution: ', solution) +print ('Completion time: ', endtime - startTime) \ No newline at end of file