Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a skeleton implementation for Day 5 Part 1 of Advent of Code 2024. The file provides a basic structure with an empty get_answer function that raises NotImplementedError, following the same pattern as other puzzle solution files in the project.
- Added new puzzle solution file with placeholder implementation
- Included command-line interface for running the solution
- Added error handling to prevent crashes when no input is provided
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def sort_update(update: list[str], order: Graph) -> list[str]: | ||
| page_numbers = set(update) | ||
| needed_order = { | ||
| page_number: order[page_number] & page_numbers for page_number in update |
There was a problem hiding this comment.
Accessing order[page_number] may raise a KeyError if page_number is not in the graph. Since order is a defaultdict in p1.py, this works only if the same instance is passed. Consider using order.get(page_number, set()) or ensure the type annotation and implementation are consistent.
| page_number: order[page_number] & page_numbers for page_number in update | |
| page_number: order.get(page_number, set()) & page_numbers for page_number in update |
No description provided.