Skip to content

Update day16.rs #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update day16.rs #4

wants to merge 1 commit into from

Conversation

dfarnham
Copy link
Contributor

@dfarnham dfarnham commented Jan 9, 2025

This isn't a proposed final fix, just an attempt to show the overflow error my input generates.

This is repository is absolutely spectacular!

Please feel free to reach out for more details if needed.

This isn't a proposed final fix, just an attempt to show the overflow error my input generates.

This is repository is absolutely spectacular!

Please feel free to reach out for more details if needed.
@maneatingape
Copy link
Owner

Great catch! Overlooked this use case.

I'd like to make sure you get a contributor credit by merging this PR but it needs to be cleaned up first.

How about simplifying by doing the following:

  • Change all instances u32 to i32 e.g.
    let mut seen = grid.same_size_with([i32::MAX; 4]);
    let mut lowest = i32::MAX;

This should fix the bug and be equally performant to the original.
Can you check this fixes the issue?

@maneatingape
Copy link
Owner

maneatingape commented Jan 9, 2025

Fixed in PR #5

Screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants