Add solution for "Day 9: Movie Theater", part 2
This commit is contained in:
@@ -70,6 +70,12 @@ When adding any new junction box, we either take connect it via the shortest edg
|
||||
|
||||
:mag_right: Puzzle: <https://adventofcode.com/2025/day/9>, :white_check_mark: Solver: [`MovieTheater`](src/solvers/movie_theater.rs)
|
||||
|
||||
The solver first collects all red tiles with info on which quadrants of each are inside the green-tiled shape, and collects the green-tiles lines that define the edge of the shape. The length of the longest of these edges is tracked as a lower bound for the solution.
|
||||
|
||||
For part 1, it then calculates areas of the rectangles spanned by each pair of red tiles that are not neighbors, and finds the largest.
|
||||
|
||||
For part 2, additional checks are included for a spanned rectangle to be considered. An interior quadrant of both red tiles has to face the other red tile, and no green-tiled edge crosses the interior of the spanned rectangle.
|
||||
|
||||
## Tests
|
||||
|
||||
The package contains integration tests for each solver, and unit tests for some, to help troubleshoot issues and prevent regressions. These tests cover the solutions for provided examples and full data inputs. The solutions used within the full data tests are user-specific.
|
||||
|
||||
Reference in New Issue
Block a user