Solve 2025 day 6#58
Merged
Merged
Conversation
This reverts commit d89618f. It doesn't work that way...
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds solutions for 2025 Day 6 parts 1 and 2, including parsing and evaluation logic for the puzzle input format.
Changes:
- Implemented Part 1 solver with operator-position-based slicing to extract per-column numbers.
- Implemented Part 2 solver that transposes the input grid to build vertical numbers and applies operators.
- Added CLI entrypoints for both parts using an embedded example input fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| puzzles/solutions/2025/d06/p1.py | Adds Part 1 parsing (get_problems) and evaluation (get_answer) driven by operator positions in the last line. |
| puzzles/solutions/2025/d06/p2.py | Adds Part 2 transpose-based parsing and evaluation using Part 1’s operation map. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+12
to
+19
| transposed_number_lines = [[]] | ||
| for line in number_lines: | ||
| try: | ||
| transposed_number_lines[-1].append(int("".join(line))) | ||
| except ValueError: | ||
| # Whitespace column, create a new problem. | ||
| transposed_number_lines.append([]) | ||
|
|
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| puzzle_input = sys.argv[1] if len(sys.argv) > 1 else p1.input_example |
Comment on lines
+9
to
+13
| number_lines = [ | ||
| [line[column] for line in number_lines] for column in range(columns_count) | ||
| ] | ||
| transposed_number_lines = [[]] | ||
| for line in number_lines: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.