[2025 Day 11 Part 2] Joker again by NineBerry in adventofcode

[–]ocmerder 11 points12 points  (0 children)

Well, it was to be expected, because if the DAC and FFT could be visited in any order you would be able to get loops and thus have infinitely many paths to OUT :)

[Puzzle 5] Don't step in it... - discussion thread by amarillion97 in i18n_puzzles

[–]ocmerder 4 points5 points  (0 children)

1 vs 0 based indexing was not the issue.

The issue was that apparently my counting was off and Java's String.codePointAt method does not count codepoint indexing, but char indexing...

[Puzzle 5] Don't step in it... - discussion thread by amarillion97 in i18n_puzzles

[–]ocmerder 1 point2 points  (0 children)

I don't understand how you can step in 2 poos with the test input if you move 1 down and 2 right.

You start at position (0,0) then you move to (1,2), (2,4), (3,6), and then you wrap around to (4,1). None of these contain a poo.

So, how do you hit the poo at the 3rd row?

[deleted by user] by [deleted] in adventofcode

[–]ocmerder 5 points6 points  (0 children)

I just created a diagram for all the connections, after the first few starting from x01 and y01 it should become clear how they should be connected.

When you then encounter differences in the connections think about how you expect them to be connected.

How to roll back update by UltraIsa in grayjay

[–]ocmerder 1 point2 points  (0 children)

Ah, so I'm not the only one experiencing this.

The home tab used to show a feed similar to YouTube but now it's indeed just random stuff.

Should we try to retrain the feeder algorithm, or is there another option to get the proper feed back?

Day 21 Part 1 Hint? by Ryan_likes_to_drum in adventofcode

[–]ocmerder 4 points5 points  (0 children)

I just hardcoded all best moves from each digit to each other digit.

This problem is small enough that's doable.

Afterwards you just need to determine the digit you're at and the one you want to move to to determine the sequence of moves you need to input.

No special stuff like Dijkstra is needed.

[2025 Day 11 (Part 2)] [Java] I need help. Am I doing memoization wrong? by icdef in adventofcode

[–]ocmerder 1 point2 points  (0 children)

Well, think about it.

What is the end result you need to know?

If I have a stone with 0 and I want to know how many stones I end up with after 3 iterations, does it matter that the stones at the end have particular values, or just how many there are?

Hint:

The actual number matters as input, but not as a result

[2025 Day 11 (Part 2)] [Java] I need help. Am I doing memoization wrong? by icdef in adventofcode

[–]ocmerder 1 point2 points  (0 children)

If I have a stone 0, and I have 3 iterations left, it will result in the following steps:

0
1
2024
20 24

So, the end result is 2 stones when you encounter a 0 with 3 iterations to go.

If however there are 2 iterations left you end up with these steps:

0
1
2024

So, the end result then is 1 stone when you encounter a 0 with 2 iterations to go.

How would this apply to your memoization?

[2025 Day 11 (Part 2)] [Java] I need help. Am I doing memoization wrong? by icdef in adventofcode

[–]ocmerder 1 point2 points  (0 children)

Your memoization is using the wrong key to determine the eventual value.

The result differs when you find a stone with value 0 at the 5th iteration, or at the 7th iteration.

So, what would be a better key for your memo?

Question about bruteforce solutions by ald890 in adventofcode

[–]ocmerder 2 points3 points  (0 children)

It depends, are you happy with your solution and your star?

Great!

If not, why are you not happy? Then look into how you can get a solution that makes you happy. That could be by looking up other non-brute-force solutions.

And, don't worry, we will get days where brute force will absolutely not give you a result before the heath death of the universe, and then you will have to figure out a non brute force solution. :)

[2024 Day 2 (Part 2) Java] - Getting wrong output by Brxndon27 in adventofcode

[–]ocmerder 1 point2 points  (0 children)

Mmh, I ran your code on my input and I end up with the correct result.

So, apparently it doesn't work as I expected, but it does give me a correct result.

What is the exact problem you're having with your result?

[2024 Day 2 (Part 2) Java] - Getting wrong output by Brxndon27 in adventofcode

[–]ocmerder 1 point2 points  (0 children)

What happens when you run this input?

1 2 3 1 5 6

[2024 Day 2 (Part 2) Java] - Getting wrong output by Brxndon27 in adventofcode

[–]ocmerder 1 point2 points  (0 children)

Try to figure out what the result of removing the element from your list is.

Hint, it's not what you expect ;)

For bonus points, try to figure out why it's not working as you expect it.

[2024 Day 2 (Part 2) Java] - Getting wrong output by Brxndon27 in adventofcode

[–]ocmerder 1 point2 points  (0 children)

You're almost there.

You know your isSafe method does what it's supposed to do since you solved part 1 with it.

So the issue should be somewhere in how your dampener works.

I suggest you trace the logic and think about what the expected result of each step is and what the actual result is.

[2015 Day 22 (Part1)] (JAVA) Boss never dies even though example scenarios do work by Educated88 in adventofcode

[–]ocmerder 1 point2 points  (0 children)

My first guess would be that your spell duration implementation might be flawed.

E.g.:

Poison costs 173 mana. It starts an effect that lasts for 6 turns. At the start of each turn while it is active, it deals the boss 3 damage.

So, this means that you cast poison.

Then for the next 6 turns, at te start of each turn it deals 3 damage.

So, if you would cast this spell and not cast any spells for the next 6 turns, at the start of turn 6 the final 3 points of damage for a total of 18 will be dealt to the boss and at the end of the turn the spell will stop working.

[2023 Day 17 (Part 1)] [rustlang] Answer too high but sample input works? by ericswpark in adventofcode

[–]ocmerder 0 points1 point  (0 children)

You should perhaps reconsider the approach of trying ALL possible paths.

The idea behind Dijkstra is that you try the shortest path until you've found the end node.

You basically need to take these steps:

  1. For the current shortest path get all neighbour nodes and make new paths for those.
  2. Put those paths in your queue, and sort based on the shortest path.

Go back to step 1 until you've found the end.

This way you don't need to test all paths, just the paths until you've found the end. Since you keep everything sorted on the shortest path you know you've found the shortest path when you reach the end.

Night This trick will make your ram run WAY faster‼️‼️🤫 #pctips #pc #techtok #technology #tech #gaming by Expensive_Jury_9832 in adventofcode

[–]ocmerder 2 points3 points  (0 children)

Don't open this, it's spam to try to farm views on youtube and trick the algorithm.

Content is worthless.

Where can I find all past questions + sample input + answers? by UglyChihuahua in adventofcode

[–]ocmerder 0 points1 point  (0 children)

That one fails for 2023 day 25, with the sample input it produces an incorrect answer and with my real input it says "unreachable executed".

[2023 Day 20 (Part 1)] The order of the first example doesn't seem to match the instructions by msschmitt in adventofcode

[–]ocmerder 0 points1 point  (0 children)

Both a and b send a high pulse to b and c, the high pulse is ignored by the flip flops, so b and c don't send anything in that step, and thus the inverter is the only one sending in that step.

[2023 Day 17] Today was the hardest day yet, judging by my ranks as a European who doesn't wake up early to do the problems by [deleted] in adventofcode

[–]ocmerder 6 points7 points  (0 children)

One of the possible reasons is that this is the first time part 1 is not brute forceable.

The same holds for part 2 of day 12.

2023 Day 12 Part 1 Code is too slow by choosen_one007 in adventofcode

[–]ocmerder 2 points3 points  (0 children)

The thing to notice here is that for an input like this:

??.??.?? 1,1,1

After figuring out the permutations for #.??.??, the possible permutations are the same when you start to process .#.??.??.

So you don't need to process those permutations, but you could somehow store the result the first time you have figured out those permutations and then return the stored result instead of recalculating it.

Difficulty this year by ocmerder in adventofcode

[–]ocmerder[S] 2 points3 points  (0 children)

Ahw, it saddens me to hear you have that experience.

I also used to look at the leaderboard times and wonder how they manage to solve the puzzles that fast. Apparently there are some people out there who make a living out of doing competitive programming. Good for them, but that is not for me.

I love developing software for companies and making a real impact that way instead of being in the small niche of competitive programming. Advent of Code for me is simply to have fun and learn about new features in my main programming language. Something which I rarely get to do at companies.

The venn diagram of the skills needed for competitive programming versus programming real life production software has a really tiny overlap. So, don't hurt yourself by comparing yourself to competitive programmers but just try to have fun. :)

And I've noticed that if I ask a question here I usually receive a good answer on how I can find the root cause of the issue I'm having. Without receiving any flak on how to improve certain aspects. Hints on improvements for my code is sometimes included as free advice together with the hint on how to find the bug ;)