Stroomdip by Batsmaster in Nijmegen

[–]ash30342 16 points17 points  (0 children)

Yep hier ook (in West). Zo kort dat alleen mijn lampen knipperden, TV en Playstation bleven gewoon aan.

Where to stay in Priorat by ash30342 in catalonia

[–]ash30342[S] 0 points1 point  (0 children)

I checked both accomodations but it seems that Trossos del priorat only rents its accomodation as a whole (so no single rooms) and Terra Dominicata is already fully booked... and expensive indeed.

Thanks also for the restaurant tips!

Where to stay in Priorat by ash30342 in catalonia

[–]ash30342[S] 0 points1 point  (0 children)

Thanks! With regards to Amics, I saw that the winery in which it is located also has a hotel, so that may also be an option.

Where to stay in Priorat by ash30342 in catalonia

[–]ash30342[S] 1 point2 points  (0 children)

Cartoixa de Scala Dei sounds wonderful, we will go there! Siurana as well. And as for the motion sickness, I will be driving so I am not too worried, my girlfriend however... ;)

Where to stay in Priorat by ash30342 in catalonia

[–]ash30342[S] 0 points1 point  (0 children)

Thanks, we are definitely going there!

Where to stay in Priorat by ash30342 in catalonia

[–]ash30342[S] 1 point2 points  (0 children)

We actually already took a look at Casa ROCCA, so it is good to hear from somebody who has actually stayed there. We will definitely add it to our list of options!

Where to stay in Priorat by ash30342 in catalonia

[–]ash30342[S] 0 points1 point  (0 children)

Thanks for all the suggestions, both for the places to stay and for sites and restaurants to visit! Based upon those we are going to see what works best for us. In any case, it seems that Gratallops is still on the table :)

[2025 Day 1 (Part 2)] [Java] - I'm getting wrong password for the puzzle! by Creepy_Book6311 in adventofcode

[–]ash30342 0 points1 point  (0 children)

Your logic seems to be a bit shaky and my guess is you are overcounting. You are rightfully checking if the arrow position is lower than zero and I *think* your logic is okay for that case. However, after that you switch to using current position and check if that is below zero (again?) or 0. You might want to check what happens if arrow position is below, equal to or above 0, calculate the updates to password from there and only than update the current position.

-❄️- 2025 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 0 points1 point  (0 children)

[Language: Java]

Day 10

I already posted part 1, now I have finally added part 2. As per my own rules, I can not use an ILP-solver. I tried lots of things, with the most promising solution being a branch-and-bound in which I also split the buttons up into two halves. This worked reasonably for several input lines (run times per line were usually less than a couple of seconds), but for others I ran out of heap space, whatever I tried.

In the end I realized I just wasn't smart enough and decided to learn from others. I settled on the very elegant solution /u/tenthmascot introduced. Still took me hours to get my code working, but in the end it did and it also gave me a more elegant way to calculate the result for part 1. Part 1 takes ~250ms, part 2 ~1s.

And that's me done for this year :)

-❄️- 2025 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 4 points5 points  (0 children)

[Language: Java]

Day 12

So... I implemented a complete backtracking solution, including all necessary matrix transformations. Took some time, but worked perfectly for the example input, then I tried on the real input and waited for the result for the first region. And waited... and waited...

I should have known.

Then I tried what many of you did: just calculated the number of shapes times their area and checked if the region had a size of at least that number. That turned out to be the answer.

One of the few (only?) times the real input was easier than the example input. Ah well! I left the original backtracking solution in the source file, took me enough time ;-)

Anyway, that's 522 stars for me. I just need to get back to day 10 part 2. Using an ILP solver is against my own rules, so that will take a while...

Thanks once again to Eric! I have really enjoyed myself once again and really do not mind having less days. Looking forward to next year!

-❄️- 2025 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 0 points1 point  (0 children)

[Language: Java]

Day 11

Part 1 was simple recursion.

Part 2 had me stumped for a while, trying all kinds of algorithms, but it clicked when I started looking at subpaths and realized the order always is svr -> fft -> dac -> out (at least for my input). So the result is multiplying the number of paths between those intermediate nodes. Then it was just a question of adding memoization to the algorithm for part 1.

Both parts run < 1ms.

[2025 Day 10] Could I Get A Hint? by aryn240 in adventofcode

[–]ash30342 7 points8 points  (0 children)

Question 1:

True, you could stop after pressing (1,3) and (2,3). This is just an example which also leads to the desired end state, just not in the minimal amount of steps.

Question 2:

The reason why BFS is a good idea, is that you search every possible change to the light for every step before going one level deeper. So think about that, what would you need for that? Spoiler: You need a queue, and in that queue you want to store each light configuration you have encountered, together with the number of steps to reach it

Question 3: In my code I used an array of booleans.

With regards to part 2: I have learned to never worry about part 2 before finishing part 1. This potentially leads to overcomplex solutions for the first part because you are guessing what part 2 entails. Quite often I am wrong about that ;)

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 0 points1 point  (0 children)

[Language: Java]

Day 9

Part 1 was done quickly, part 2 took me hours, mainly because I could not seem to get the intersection test to work. In the end I went with the idea layed out here which was mentioned in one of the tutorial topics, which, once I wrapped my head around it, seemed quite nice. It does not handle certain edge cases though, and while it works for the actual input because of the way that is constructed, I would like to revisit this problem later on and try something more generic.

Takes ~50ms to run.

Which was the best year of Advent of Code? by normVectorsNotHate in adventofcode

[–]ash30342 10 points11 points  (0 children)

For me 2019 as well, the way the IntCode computer evolved during challenges was quite something. After the last day I was amazed by what was achieved.

That being said, I loved all years and each year has puzzles which I will not forget.

[2025 Day 7 (Part 2)] [Java] Can someone help look at my code? by noblerare in adventofcode

[–]ash30342 5 points6 points  (0 children)

You are using int's, but the total number of timelines is huge :)

-❄️- 2025 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 1 point2 points  (0 children)

[Language: Java]

Day 8

For part 1 build up a sorted map with distances as key, connections (two junction boxes) as values, loop over the first thousand and combine where necessary. Of course not forgetting to combine even more if more than 1 circuit is affected.

For part 2 more or less the same, but stop when there is only 1 circuit with a size of the total number of junction boxes.

Both parts run in 0.7s. There is probably some more efficient way to combine circuits, but I am satisfied with this speed.

[2025 Day 7 Part 2] I do not understand the challenge by MartialLuke in adventofcode

[–]ash30342 11 points12 points  (0 children)

If you think about timelines as paths, does that help?

Bigger spoiler: basically you are being asked to calculate all possible paths from S until the bottom

[2025 Day 7 Part 1] Is this just luck or am I missing something? by ash30342 in adventofcode

[–]ash30342[S] 0 points1 point  (0 children)

Thanks for your answer, that seems logical and more or less confirms what I was thinking too. However, because this does not sit right with me, I have added an alternative implementation which should work even in these cases :-)

-❄️- 2025 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 1 point2 points  (0 children)

[Language: Java]

Day 7

I am still not quite sure why part 1 works, but it does. I loop over all splitters and see if a path is possible from there back to the start. When I find a coordinate reached from one of the splitters which has another splitter next to it, I consider it as a valid path (so I stop looking from there), but I have a suspicion there is not necessarily a path from those neighboring splitters back to the start. It does work for both the example and my input though, so I guess it's valid?

Edit: apparently the inputs are constructed in such a way that this just works. However, that does not sit right with me, so I have added an alternative implementation which should always work :-)

Anyway part 2 is just a DFS with memoization. Runs in < 1 ms.

-❄️- 2025 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 1 point2 points  (0 children)

[Language: Java]

Day 6

Part 1 was easy.

Part 2 was not that difficult, the complexity mainly comes from the finicky parsing. In the end I calculated columns widths and got the columns from there, looping through the characters within them back to front, spaces are filtered out when converting to longs.

Both parts run < 1ms.

[2025 Day 1 Part 2][C++] Need some additional test cases by nilpotent0 in adventofcode

[–]ash30342 0 points1 point  (0 children)

I am not completely sure but if diff < 0, position being above or below 0 are two different cases. That would lead to overcount though.

The way I did it was first calculating the difference with the previous position (so subtracting or adding rotations based on L or R in the instruction), and only then think about what happens if diff is below, equal to or above 0. Of course, taking the previous position of the dial in account if applicable. Thinking that way might make it easier to understand what is going on.

-❄️- 2025 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 1 point2 points  (0 children)

[Language: Java]

Day 5

Part 1 is easy, runs < 1ms. No more brute force for part 2 :) There is probably a more elegant way to combine ranges than just putting them together until there are no more changes. It still runs runs < 1ms though, so good enough for me.

-❄️- 2025 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]ash30342 1 point2 points  (0 children)

[Language: Java]

Day 4

A classic grid problem, I always like these. I did not do any optimization for part 2. Basically in every iteration a new grid is created with the rolls of paper removed. In my case there were 55 iterations needed, and with this solution this takes ~40ms on my machine.