We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm pretty sure your day 9 part 2 works because you do not join consecutive empty blocks together.
Let's take the test input, where block 8 should not be moved: 00...111...2...333.44.5555.6666.777.888899
00...111...2...333.44.5555.6666.777.888899
In your data it would look like this:
00 | ... | 111 | ... | 2 | ... | 333 | . | 44 | . | 5555 | . | 6666 | . | 777 | . | 8888 | 99
After moving block 9 and block 7 it is
00 | 99 | . | 111 | 777 | 2 | ... | 333 | . | 44 | . | 5555 | . | 6666 | . | ... | . | 8888 | ..
Now there are 5 empty spaces, and block 8 would fit, but for your algorithm it looks like (1+3+1) empty spaces.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm pretty sure your day 9 part 2 works because you do not join consecutive empty blocks together.
Let's take the test input, where block 8 should not be moved:
00...111...2...333.44.5555.6666.777.888899
In your data it would look like this:
00 | ... | 111 | ... | 2 | ... | 333 | . | 44 | . | 5555 | . | 6666 | . | 777 | . | 8888 | 99
After moving block 9 and block 7 it is
00 | 99 | . | 111 | 777 | 2 | ... | 333 | . | 44 | . | 5555 | . | 6666 | . | ... | . | 8888 | ..
Now there are 5 empty spaces, and block 8 would fit, but for your algorithm it looks like (1+3+1) empty spaces.
The text was updated successfully, but these errors were encountered: