Skip to content
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

Make 2015 Day 24 python robust against some inputs #2

Open
rHermes opened this issue Oct 26, 2021 · 0 comments
Open

Make 2015 Day 24 python robust against some inputs #2

rHermes opened this issue Oct 26, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request python

Comments

@rHermes
Copy link
Owner

rHermes commented Oct 26, 2021

My solution to 2015 Day 24 returns the first solution it finds. In many cases this is right, but there are counter examples:

INPUT: 1 3 5 13 17 23 31 37 53
[1, 23, 37], QE is 851.
[3, 5, 53], QE is 795.

or

INPUT: 1 2 3 6 7 8 9 11 16
[1, 9, 11], QE is 99,
[2, 3, 16], QE is 96.

My initial code can handle this, but my cleaned up version does not. The way to handle this is to keep track of the smallest in the top of the loop and then do the same towards the bottom, but I think this makes the code more ugly, so I'm putting it of until later.

@rHermes rHermes added enhancement New feature or request python labels Oct 26, 2021
@rHermes rHermes self-assigned this Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
None yet
Development

No branches or pull requests

1 participant