Skip to content

Solve 2024 day 5#46

Merged
katzuv merged 12 commits intomainfrom
solve/2024-05
Oct 29, 2025
Merged

Solve 2024 day 5#46
katzuv merged 12 commits intomainfrom
solve/2024-05

Conversation

@katzuv
Copy link
Copy Markdown
Owner

@katzuv katzuv commented Oct 26, 2025

No description provided.

@github-actions github-actions bot added the Solution Puzzle solution label Oct 26, 2025
@katzuv katzuv marked this pull request as ready for review October 29, 2025 16:53
Copilot AI review requested due to automatic review settings October 29, 2025 16:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@katzuv katzuv requested a review from Copilot October 29, 2025 16:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings October 29, 2025 17:01
@katzuv katzuv merged commit b3e7bf5 into main Oct 29, 2025
7 checks passed
@katzuv katzuv deleted the solve/2024-05 branch October 29, 2025 17:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Solution Puzzle solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants