Skip to content

Conversation

@truggeri
Copy link
Owner

Summary

Solving the day 7 puzzle. This works by iterating through every given coefficient and putting into a list the previous possibilities added and multiplied the coefficient. This solution works, but the worst case time is O(2^n) which is terrible. If any of the possibilities are greater than the equation result, we abandon it. This is possible because each coefficient is a whole positive number, so it's impossible for the running total to decrease.

@truggeri truggeri self-assigned this Dec 16, 2024
@truggeri truggeri merged commit 9d99fa9 into main Dec 16, 2024
1 check passed
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