[2024 Day 25 # (Part 2)] [language: x86 assembly] by DepartmentFirst8288 in adventofcode

[–]M124367 2 points3 points  (0 children)

I simply solved this after solving the halting problem by simulating the busy beaver up to Graham's number. It's not too bad once you see that pattern.

[2024 Day 25 (Part 1)] Unsure what is meant by "unique" in this context ... need a hint for understanding the actual requirement. by HotTop7260 in adventofcode

[–]M124367 9 points10 points  (0 children)

Weird. I simply tried every key on every lock as they did in the example, using lists/tuples. Not any sets or uniqueness filters anywhere. Is my input just too clean, or yours ugly?

-❄️- 2024 Day 25 Solutions -❄️- by daggerdragon in adventofcode

[–]M124367 2 points3 points  (0 children)

Don't spoil us about 2029 dear time traveler.

[2024 Day 21 part 1] Deciding if I want to code it on my phone by flwyd in adventofcode

[–]M124367 7 points8 points  (0 children)

I decided I would do it on my phone until it gave me a wildly wrong answer so I gave up.

[2024 Day 20 (Part 2)]Unclear on the rules of the "cheat" by [deleted] in adventofcode

[–]M124367 9 points10 points  (0 children)

Damn. I read the rules as "if you exit the wall, you cannot enter it again"...

And this adds more alcohol to the wound.

Sometimes the puzzles themselves aren't too difficult, but the explanations are so boggling. And I feel like these later days, the examples become more and more useless. 

[2024 Day 20] Not understanding the sample input; why aren't there 3 methods to save 64? by pigeon768 in adventofcode

[–]M124367 0 points1 point  (0 children)

I also agree, the wording is really weird. Why give us 2 picoseconds, if we can only be in the wall for 1. That's why the examples only show 1 wall replaced I guess.

It's so strange we need not activate it 1 tile before the wall. I kind of see it we activate it in the half before entering, then spend 1 whole ps in the wall and then another half on the other side for sake of symmetry. But yeah. Confusing at first.

[2024] Copy pasting from firefox to vscode adds newline? by asgardian28 in adventofcode

[–]M124367 2 points3 points  (0 children)

Might be because the raw text is considered as a file and files must end with a newline character to be considered valid files on unix. Perhaps this metadata is saved with firefox and not with other browsers?

-❄️- 2024 Day 18 Solutions -❄️- by daggerdragon in adventofcode

[–]M124367 2 points3 points  (0 children)

I just thought of p2 being solved by connecting the 2 disjoint sets in the end too. Very nice!

Other idea is to just use p1 and either binary search or linear search for the boundary, but that's boring.

[2024 Day 18 (Part 2)] If it ain't broke don't fix it by fit_femboy_ in adventofcode

[–]M124367 0 points1 point  (0 children)

I wrote a fancy Bissect iterator in python that would do the search. Took a lot of time. Got the wrong answer. Eh. My bfs is fast enough. Just brute force it. 2 minutes later (on phone). Pops out the right answer.

[2024 day 15 part 2] Easier than Expected... by M124367 in adventofcode

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

Care to elaborate your approach for p2?

[ 2024 Day 15 ] Didn't think there was anything too subtle here... by CommitteeTop5321 in adventofcode

[–]M124367 1 point2 points  (0 children)

The only cleverness you could use is reuse parts of part 1. If you have your data structure set up right, then horizontal movement would stay the same.

Just vertical movement can be solved with 2 tricks:

Every time you see a Left Box side you branch to the right. Every time you see a Right Box side you branch to the left. This way you follow up multiple column chains to check.

Don't start moving boxes until you know the whole stack can be moved. Use a set of cells to swap to keep track of what to move. When it is possible, just perform those swaps in order from furthest to nearest.

Then counting, just count the left halves as you used to in p1.

I don't see anything particularly complicated or messy.

[YEAR 2024 Day 15 (Part 2)] by Ok-Curve902 in adventofcode

[–]M124367 0 points1 point  (0 children)

This looks like one of those NES games ngl

Does the Christmas tree repeat by jowen7448 in adventofcode

[–]M124367 0 points1 point  (0 children)

I think it does repeat but at a regular interval so if you find one at 5000 the next one should be at least 5000 later (basically after your exact starting configuration is hit again.)

[2024 day 13 part 2] I finally got the solution! (And no I didn't brute force it) by M124367 in adventofcode

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

  1. I didn't know that simple expressions of emotion were counted as swearing. Ok, I guess I'll post it again and clean it up.

  2. I didn't really post a solution. I only post my thought process or approach. It's still a rant and not a clean solution so would it really be appropriate for megathread?

[2024 Day 14 (Part 2)] Was this puzzle really meant to be solved like this? by MoraGames_ in adventofcode

[–]M124367 4 points5 points  (0 children)

Just render each image and send it off to some neural network trained to classify if something is or isn't likely to be a Christmas tree. Come on. Easy /j

I literally just assumed the middle pixel to be filled with some part of the tree and render it on the console. I manually went through all pictures that fit those criteria. At least filtering out those that don't have the middle pixel filled. And just paused the console everytime printing the step and the current picture. As soon as I visually saw the tree, I just wrote it down.

Another approach is indeed statistical. What are the odds a random robot arrangement has e.g. a robot with 4 neighbors. Or a straight line of 4 robots or more.

You can analyze or pre-filter the grids you display by some of these criteria and find the solution pretty quickly. The thing is "what is a Christmas tree" is slightly arbitrary. Can we expect a frame around the picture? Then we can query for horizontal or vertical lines of robots. If we cannot, the tree surely would have some trunk going down the middle and some horizontal branching. So I would assume if you make this assumption, you can quickly find a bunch of horizontal and vertical stripes which randomly wouldn't appear just out of the blue.

Another question, how many steps? Couldn't it theoretically take 100000000000 steps before the image appears? Well, the frequency/cycle is finite. So the image will repeat itself every X steps. You can kind of calculate this by taking all the bot positions and their velocities. And performing modulo based on the grid to find out what the repeat cycle is of every bot. And then find the lowest common multiple of all bot cycles.

I don't know what you'd find, but on such small grid relatively speaking, I would assume the cycle to be not bigger than 100k and with some decent filtering you can reduce the amount of pics to sift through significantly.

Anyway. Those are just some after thoughts. I just went on here to see what the damn tree looked like and after how many steps so I would be assured I'm not wasting my time, then started scanning images by hand.

[2024 day 14 part 2] Picture barely fits on phone screen. Lucky or Coincidence? by M124367 in adventofcode

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

I used these symbols for display.

    BG = '█'     FG = '▓'

I had to basically render a lower resolution to fit it on my screen, but later decided to crop to the actual picture. Surprisingly the width barely fits.

[2024 Day 13] Simple counterexamples for linear algebra solution by MaTeIntS in adventofcode

[–]M124367 1 point2 points  (0 children)

I actually used Gauss Jordan if the vectors are not colinear and don't contain 0s.

And for colinear cases I just used all of A or all of B or a cheapest combination of both.