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

Day 16 part 2: computing the answer can be 2^n * n #1

Open
mbuzdalov opened this issue Dec 22, 2022 · 1 comment
Open

Day 16 part 2: computing the answer can be 2^n * n #1

mbuzdalov opened this issue Dec 22, 2022 · 1 comment

Comments

@mbuzdalov
Copy link

fun find(i: Int, m1: Long, m2: Long): Int {

If you "expand" bm such that it represents the best solution on a subset of the argument, you don't need the third subset :)

@elizarov
Copy link
Owner

👏 Nice trick. Thanks!

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

No branches or pull requests

2 participants