Skip to content
Permalink

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
Choose a base ref
...
head repository: rHermes/adventofcode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 10 commits
  • 26 files changed
  • 1 contributor

Commits on Jan 9, 2024

  1. Cleanup of 2023 Day 17

    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.
    rHermes committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    35fd928 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. Cleanup of 2023 Day 18

    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.
    rHermes committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    8c9213b View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2024

  1. 2023 Day 21 Part two

    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.
    rHermes committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    a5f27d4 View commit details
    Browse the repository at this point in the history
  2. 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!
    rHermes committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    ac646de View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f7f29d7 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2024

  1. Small fixup 2023 Day 5

    rHermes committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    9662f2a View commit details
    Browse the repository at this point in the history
  2. Cleanup of 2023 Day 16

    There are cleaner ways to implement this, using complex numbers, but for
    now I am ok with my solution.
    rHermes committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    bc0b80d View commit details
    Browse the repository at this point in the history
  3. Cleanup of 2023 Day 19

    This solution was already good, I just had to remove a few comments. I'm
    proud of part two here.
    rHermes committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    fd1e83e View commit details
    Browse the repository at this point in the history
  4. Cleanup of 2023 Day 23

    This was just another round of removing unneeded imports and removing
    comments.
    rHermes committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    1af8afd View commit details
    Browse the repository at this point in the history
  5. Solve 2016 Day 22 Part 2

    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.
    rHermes committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    5977327 View commit details
    Browse the repository at this point in the history
Loading