-
Notifications
You must be signed in to change notification settings - Fork 0
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Checking mergeability…
Don’t worry, you can still create the pull request.
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: rHermes/adventofcode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2023/d24-part-two
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: rHermes/adventofcode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 10 commits
- 26 files changed
- 1 contributor
Commits on Jan 9, 2024
-
So this was an interesting day and even if I'm committing this now, I did the changes the day it was solved, but I didn't have time to write a longer commit message. But I remember this day quite well, so I'm writing them now. So it turns out I was extremely lucky today. I lucked out on both parts, in two different ways. The first mistake I made, which I made in both parts, is that I started the "going right" starting point, with 1 step, which is not correct. I did however start the "going down" with 0 steps, which is the correct thing to do. And luckily both part one and part two's solutions start with going down. The second mistake I made was that I started the left and right steps with 0 steps, instead of 1. This just had the effect of making it so I had to do less than or equal to 2 instead of 3, but I wondered why it was like this during the competition. The last piece of luck I had was that I didn't read the final line, that you had to move at least 3 squares, also on the last move! In the end it didn't matter for my solution, but it easily could have! The way I figured out most of these mistakes, was that I actually thought I had found a bug in the puzzle. I got a path that was cheaper than the answer on part two, and wondered how this could be. This was after I fixed the "1 step on going right" bug I describe above. After visualizing the mistake and other things, I made sure that the route described was correct and went to reddit to make a comment. That's when I read in the mega thread about the fact that you had to move at least 3 squares also on the last move and also the fact that other inputs had been tricky with the starting with 0 steps policy. Overall I was very lucky on this day, I think it could have taken a long time to debug why my answer was not the answer, especially as it was lower than the actual answer.
Configuration menu - View commit details
-
Copy full SHA for 35fd928 - Browse repository at this point
Copy the full SHA 35fd928View commit details
Commits on Jan 10, 2024
-
This was just cleaning up a bit, but it seems that we could improve this more, by reading the reddit thread. I will try to do this, but right now this is just a cleanup commit.
Configuration menu - View commit details
-
Copy full SHA for 8c9213b - Browse repository at this point
Copy the full SHA 8c9213bView commit details
Commits on Jan 17, 2024
-
And with this, I have finally solved all the tasks in 2023. I was reluctant to enter into this one, because I thought it would get rather ugly, but once again, the input is very kind. I was able to solve it, by noticing that there is no stones in the starting row or the starting column. There are also no stones on the edge of the map. Using this, I partition the grid into 8 zones and I calculate how many plots we get to for each zone. This is fast and runs in O(B) where B is the size of the initial board, as we have to do a BFS search on the board to figure out which spots are reachable and the cost of reaching each space. reading the reddit thread, it appears that it's possible to solve this in some other way, using a diamond shape. I slept really badly tonight so I'll look into that a bit later.
Configuration menu - View commit details
-
Copy full SHA for a5f27d4 - Browse repository at this point
Copy the full SHA a5f27d4View commit details -
Add explanation to 2023 Day 24 Part 2
This finishes this part of the saga, I've learned a lot and I'm very happy that I took this deep dive into this task!
Configuration menu - View commit details
-
Copy full SHA for ac646de - Browse repository at this point
Copy the full SHA ac646deView commit details -
Configuration menu - View commit details
-
Copy full SHA for f7f29d7 - Browse repository at this point
Copy the full SHA f7f29d7View commit details
Commits on Jan 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9662f2a - Browse repository at this point
Copy the full SHA 9662f2aView commit details -
There are cleaner ways to implement this, using complex numbers, but for now I am ok with my solution.
Configuration menu - View commit details
-
Copy full SHA for bc0b80d - Browse repository at this point
Copy the full SHA bc0b80dView commit details -
This solution was already good, I just had to remove a few comments. I'm proud of part two here.
Configuration menu - View commit details
-
Copy full SHA for fd1e83e - Browse repository at this point
Copy the full SHA fd1e83eView commit details -
This was just another round of removing unneeded imports and removing comments.
Configuration menu - View commit details
-
Copy full SHA for 1af8afd - Browse repository at this point
Copy the full SHA 1af8afdView commit details -
This turned out to be very easy once you realized that we are not trying to solve the generalized version of the problem at all, but rather something specific to our input. It can be reduced to just a few types of nodes, either too big, empty or normal nodes. After that it's just a simple calculation of finding the shortest path to the tile before the target data and calculating how many steps it would take to move this data all the way to the left. This is of course assuming, that we have no blockers in the top column.
Configuration menu - View commit details
-
Copy full SHA for 5977327 - Browse repository at this point
Copy the full SHA 5977327View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 2023/d24-part-two...master